public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/3] xf86-video-intel: Fix fd_set_nonblock
@ 2014-02-14 23:02 Hans de Goede
  2014-02-14 23:02 ` [PATCH 2/3] xf86-video-intel: export fd_set_cloexec / fd_set_nonblock Hans de Goede
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Hans de Goede @ 2014-02-14 23:02 UTC (permalink / raw)
  To: intel-gfx; +Cc: peter.hutterer

O_NONBLOCK is a status flag not a descriptor flag, so F_GETFL / F_SETFL should
be used to modify it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/intel_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/intel_device.c b/src/intel_device.c
index effda24..07b7d2e 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -167,10 +167,10 @@ static int fd_set_nonblock(int fd)
 	if (fd == -1)
 		return fd;
 
-	flags = fcntl(fd, F_GETFD);
+	flags = fcntl(fd, F_GETFL);
 	if (flags != -1) {
 		flags |= O_NONBLOCK;
-		fcntl(fd, F_SETFD, flags);
+		fcntl(fd, F_SETFL, flags);
 	}
 
 	return fd;
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-02-15 21:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-14 23:02 [PATCH 1/3] xf86-video-intel: Fix fd_set_nonblock Hans de Goede
2014-02-14 23:02 ` [PATCH 2/3] xf86-video-intel: export fd_set_cloexec / fd_set_nonblock Hans de Goede
2014-02-14 23:02 ` [PATCH 3/3] xf86-video-intel: Add a helper for setting backlight without root rights Hans de Goede
2014-02-14 23:54   ` Chris Wilson
2014-02-15  8:48     ` Hans de Goede
2014-02-15 11:52       ` Chris Wilson
2014-02-15 21:37         ` Hans de Goede
2014-02-15 11:53       ` [PATCH] intel: " Chris Wilson
2014-02-15 15:47         ` Chris Wilson
2014-02-14 23:44 ` [PATCH 1/3] xf86-video-intel: Fix fd_set_nonblock Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox