diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-01-11 12:47:14 -0500 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-05-17 15:22:15 +0200 |
commit | 6d1d622bf1f4da725d11cbe5c57a757869ae54c6 (patch) | |
tree | 1c34ed1dcf37abf41bb154c3fcedd9fb1bce8b88 /src/login/logind-dbus.c | |
parent | 75cbb152e09780f094d869c5d92d6815442f2900 (diff) |
tree-wide: check if errno is greater then zero
gcc is confused by the common idiom of
return errno ? -errno : -ESOMETHING
and thinks a positive value may be returned. Replace this condition
with errno > 0 to help gcc and avoid many spurious warnings. I filed
a gcc rfe a long time ago, but it hard to say if it will ever be
implemented [1].
Both conventions were used in the codebase, this change makes things
more consistent. This is a follow up to bcb161b0230f.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61846
Diffstat (limited to 'src/login/logind-dbus.c')
-rw-r--r-- | src/login/logind-dbus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 64e67409e..5dfe5aab2 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -1117,7 +1117,7 @@ static int method_set_user_linger(sd_bus_message *message, void *userdata, sd_bu errno = 0; pw = getpwuid(uid); if (!pw) - return errno ? -errno : -ENOENT; + return errno > 0 ? -errno : -ENOENT; r = bus_verify_polkit_async( message, |