From: David Herrmann Date: Thu, 11 Sep 2014 13:29:58 +0000 (+0200) Subject: terminal: fix wrong return value in idev if fcntl() fails X-Git-Tag: v217~601 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=667b60341f404d8f18aa0909e34d39e7d6baa56b 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. --- diff --git a/src/libsystemd-terminal/idev-evdev.c b/src/libsystemd-terminal/idev-evdev.c index be9b0301a..241743c3f 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)