summaryrefslogtreecommitdiff
path: root/src/libsystemd-terminal/idev-evdev.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-09-11 15:29:58 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2014-09-11 15:29:58 +0200
commit667b60341f404d8f18aa0909e34d39e7d6baa56b (patch)
treebba3f01d524c27f9764769bda492c4ac77f14b15 /src/libsystemd-terminal/idev-evdev.c
parentc600022303a10155f48a8eab59c6c0ae1b797699 (diff)
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.
Diffstat (limited to 'src/libsystemd-terminal/idev-evdev.c')
-rw-r--r--src/libsystemd-terminal/idev-evdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-terminal/idev-evdev.c b/src/libsystemd-terminal/idev-evdev.c
index be9b0301a4..241743c3fd 100644
--- a/src/libsystemd-terminal/idev-evdev.c
+++ b/src/libsystemd-terminal/idev-evdev.c
@@ -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)