tree-wide: check if errno is greater than zero (2)
Compare errno with zero in a way that tells gcc that (if the condition is true) errno is positive.
This commit is contained in:
@@ -648,7 +648,7 @@ int cg_trim(const char *controller, const char *path, bool delete_root) {
|
||||
if (nftw(fs, trim_cb, 64, FTW_DEPTH|FTW_MOUNT|FTW_PHYS) != 0) {
|
||||
if (errno == ENOENT)
|
||||
r = 0;
|
||||
else if (errno != 0)
|
||||
else if (errno > 0)
|
||||
r = -errno;
|
||||
else
|
||||
r = -EIO;
|
||||
@@ -2091,7 +2091,7 @@ int cg_kernel_controllers(Set *controllers) {
|
||||
if (feof(f))
|
||||
break;
|
||||
|
||||
if (ferror(f) && errno != 0)
|
||||
if (ferror(f) && errno > 0)
|
||||
return -errno;
|
||||
|
||||
return -EBADMSG;
|
||||
|
||||
Reference in New Issue
Block a user