When we check the exit status of a subprocess, let's compare it with
EXIT_SUCCESS rather than 0 when looking for success.
This clarifies in code what kind of variable we are looking at and what
we are doing.
pid = 0;
if (r < 0)
goto finish;
- if (r > 0) {
+ if (r != EXIT_SUCCESS) {
log_error("DOWNLOAD INVALID: Signature verification failed.");
r = -EBADMSG;
} else {
i->tar_pid = 0;
if (r < 0)
goto finish;
- if (r > 0) {
+ if (r != EXIT_SUCCESS) {
r = -EIO;
goto finish;
}
if (j < 0)
return j;
if (streq(verb, "is-enabled")) {
- if (j == 0) {
+ if (j == EXIT_SUCCESS) {
if (!arg_quiet)
puts("enabled");
r = 1;
puts("disabled");
}
- } else if (j != 0)
+ } else if (j != EXIT_SUCCESS)
return -EBADE; /* We don't warn here, under the assumption the script already showed an explanation */
if (found_native)