From: Hans de Goede Subject: [PATCH 2/3] xf86-video-intel: export fd_set_cloexec / fd_set_nonblock Date: Sat, 15 Feb 2014 00:02:36 +0100 Message-ID: <1392418957-12889-2-git-send-email-hdegoede@redhat.com> References: <1392418957-12889-1-git-send-email-hdegoede@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id ABEC6FA67B for ; Fri, 14 Feb 2014 15:02:41 -0800 (PST) Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1EN2fCd009335 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 14 Feb 2014 18:02:41 -0500 In-Reply-To: <1392418957-12889-1-git-send-email-hdegoede@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org Cc: peter.hutterer@redhat.com List-Id: intel-gfx@lists.freedesktop.org Allow fd_set_cloexec / fd_set_nonblock to be used outside of intel_device.c. Signed-off-by: Hans de Goede --- 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