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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2013-04-11 19:13:18 -04:00
parent 0ad4e1a872
commit bcb161b023
8 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -5260,7 +5260,7 @@ static int talk_initctl(void) {
r = loop_write(fd, &request, sizeof(request), false) != sizeof(request);
if (r) {
log_error("Failed to write to "INIT_FIFO": %m");
return errno ? -errno : -EIO;
return errno > 0 ? -errno : -EIO;
}
return 1;