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:
@@ -1637,7 +1637,7 @@ UnitFileState unit_file_get_state(
|
||||
return state;
|
||||
|
||||
r = unit_file_can_install(&paths, root_dir, path, true);
|
||||
if (r < 0 && errno != -ENOENT)
|
||||
if (r < 0 && errno != ENOENT)
|
||||
return r;
|
||||
else if (r > 0)
|
||||
return UNIT_FILE_DISABLED;
|
||||
|
||||
Reference in New Issue
Block a user