]> git.ipfire.org Git - thirdparty/systemd.git/commit
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)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 13 Jan 2016 20:09:55 +0000 (15:09 -0500)
commitf5e5c28f42a2f6d006785ec8b5e98c11a71bb039
tree401964b6763a9d3a5062ccf7b817ccd5e94c4081
parentd9a090b9957b04ec34a145a0a40f41abafe73917
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
14 files changed:
src/basic/cgroup-util.c
src/basic/fileio.c
src/basic/glob-util.c
src/basic/in-addr-util.c
src/basic/terminal-util.c
src/core/execute.c
src/firstboot/firstboot.c
src/getty-generator/getty-generator.c
src/import/aufs-util.c
src/locale/localed.c
src/login/logind-core.c
src/login/logind-dbus.c
src/sysusers/sysusers.c
src/udev/udev-builtin-blkid.c