diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-04-12 00:57:42 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-04-12 01:13:18 +0200 |
commit | bcb161b0230fdd1faf9176f95fee76a7db6afd59 (patch) | |
tree | c3ba8c1cf806c961842bd51b42c6e8f9b7b59c6e /src/login | |
parent | systemctl: show the name of failing unit in red (diff) | |
download | systemd-bcb161b0230fdd1faf9176f95fee76a7db6afd59.tar.xz systemd-bcb161b0230fdd1faf9176f95fee76a7db6afd59.zip |
errno is positive
Make sure we compare errno against positive error codes.
The ones in hwclock.c and install.c can have an impact, the
rest are unlikely to be hit or in code that isn't widely
used.
Also check that errno > 0, to help gcc know that we are
returning a negative error code.
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/sd-login.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/login/sd-login.c b/src/login/sd-login.c index 7513f76cb3..f433e3e80b 100644 --- a/src/login/sd-login.c +++ b/src/login/sd-login.c @@ -730,7 +730,7 @@ _public_ int sd_login_monitor_new(const char *category, sd_login_monitor **m) { fd = inotify_init1(IN_NONBLOCK|IN_CLOEXEC); if (fd < 0) - return errno; + return -errno; if (!category || streq(category, "seat")) { k = inotify_add_watch(fd, "/run/systemd/seats/", IN_MOVED_TO|IN_DELETE); |