[Intel-gfx] [PATCH 2/3] xf86-video-intel: export fd_set_cloexec / fd_set_nonblock

Hans de Goede hdegoede at redhat.com
Sat Feb 15 00:02:36 CET 2014


Allow fd_set_cloexec / fd_set_nonblock to be used outside of intel_device.c.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 src/intel_device.c | 8 ++++----
 src/intel_driver.h | 2 ++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/intel_device.c b/src/intel_device.c
index 07b7d2e..fd0b735 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -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;
diff --git a/src/intel_driver.h b/src/intel_driver.h
index b2cb1b9..52c2768 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -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);
-- 
1.8.5.3




More information about the Intel-gfx mailing list