chiark / gitweb /
tree-wide: check if errno is greater then zero
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 11 Jan 2016 17:47:14 +0000 (12:47 -0500)
committerSven Eden <yamakuzure@gmx.net>
Wed, 17 May 2017 13:22:15 +0000 (15:22 +0200)
commit6d1d622bf1f4da725d11cbe5c57a757869ae54c6
tree1c34ed1dcf37abf41bb154c3fcedd9fb1bce8b88
parent75cbb152e09780f094d869c5d92d6815442f2900
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
src/basic/cgroup-util.c
src/basic/fileio.c
src/basic/terminal-util.c
src/login/logind-core.c
src/login/logind-dbus.c