@@ -142,7 +142,7 @@ static int __intel_check_device(int fd)
return ret;
}
-static int fd_set_cloexec(int fd)
+int intel_fd_set_cloexec(int fd)
{
int flags;
@@ -160,7 +160,7 @@ static int fd_set_cloexec(int fd)
return fd;
}
-static int fd_set_nonblock(int fd)
+int intel_fd_set_nonblock(int fd)
{
int flags;
@@ -209,7 +209,7 @@ static int __intel_open_device(const struct pci_device *pci, char **path)
fd = -1;
}
}
- fd = fd_set_nonblock(fd);
+ fd = intel_fd_set_nonblock(fd);
} else {
#ifdef O_CLOEXEC
fd = open(*path, O_RDWR | O_NONBLOCK | O_CLOEXEC);
@@ -217,7 +217,7 @@ static int __intel_open_device(const struct pci_device *pci, char **path)
fd = -1;
#endif
if (fd == -1)
- fd = fd_set_cloexec(open(*path, O_RDWR | O_NONBLOCK));
+ fd = intel_fd_set_cloexec(open(*path, O_RDWR | O_NONBLOCK));
}
return fd;
@@ -126,6 +126,8 @@ int intel_open_device(int entity_num,
const struct pci_device *pci,
struct xf86_platform_device *dev);
int intel_get_device(ScrnInfoPtr scrn);
+int intel_fd_set_cloexec(int fd);
+int intel_fd_set_nonblock(int fd);
const char *intel_get_client_name(ScrnInfoPtr scrn);
int intel_get_device_id(ScrnInfoPtr scrn);
int intel_get_master(ScrnInfoPtr scrn);
Allow fd_set_cloexec / fd_set_nonblock to be used outside of intel_device.c. Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- src/intel_device.c | 8 ++++---- src/intel_driver.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-)