Message ID | 1392418957-12889-1-git-send-email-hdegoede@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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 --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;
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(-)