summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-02-15 00:02:35 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-02-15 00:01:30 +0000
commit5601f8cc330fe88eadfa7238659c5abb223e3b28 (patch)
tree1abb41e3b0663f4c0a329378323f068d17c6a225
parent8eb6335653e6e38228ecf95c3eef82ca2a864e45 (diff)
intel: Fix fd_set_nonblock
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>
-rw-r--r--src/intel_device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/intel_device.c b/src/intel_device.c
index 8fd78827..e6fda195 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;