diff mbox

[1/3] xf86-video-intel: Fix fd_set_nonblock

Message ID 1392418957-12889-1-git-send-email-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Hans de Goede Feb. 14, 2014, 11:02 p.m. UTC
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(-)

Comments

Chris Wilson Feb. 14, 2014, 11:44 p.m. UTC | #1
On Sat, Feb 15, 2014 at 12:02:35AM +0100, Hans de Goede wrote:
> 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>

Oops, that was a silly typo that unfortunately compiled.
Thanks,
-Chris
diff mbox

Patch

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;