terminal: fix wrong return value in idev if fcntl() fails

This might cause >=0 to be returned, even though the method failed. Fix
this and return -errno.
This commit is contained in:
David Herrmann
2014-09-11 15:29:58 +02:00
parent c600022303
commit 667b60341f
+1 -1
View File
@@ -307,7 +307,7 @@ static int idev_evdev_resume(idev_evdev *evdev, int dev_fd) {
flags = fcntl(fd, F_GETFL, 0);
if (flags < 0)
return r;
return -errno;
flags &= O_ACCMODE;
if (flags == O_WRONLY)