intel: Fix fd_set_nonblock
authorHans de Goede <hdegoede@redhat.com>
Fri, 14 Feb 2014 23:02:35 +0000 (00:02 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 15 Feb 2014 00:01:30 +0000 (00:01 +0000)
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

index 8fd7882..e6fda19 100644 (file)
@@ -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;