tree-wide: use EXIT_SUCCESS when comparing child process exit statuses

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.
This commit is contained in:
Lennart Poettering 2017-12-29 18:12:30 +01:00
parent d2e0ac3d1e
commit b4a343112e
3 changed files with 4 additions and 4 deletions

View file

@ -546,7 +546,7 @@ int pull_verify(PullJob *main_job,
pid = 0;
if (r < 0)
goto finish;
if (r > 0) {
if (r != EXIT_SUCCESS) {
log_error("DOWNLOAD INVALID: Signature verification failed.");
r = -EBADMSG;
} else {

View file

@ -337,7 +337,7 @@ static void tar_pull_job_on_finished(PullJob *j) {
i->tar_pid = 0;
if (r < 0)
goto finish;
if (r > 0) {
if (r != EXIT_SUCCESS) {
r = -EIO;
goto finish;
}

View file

@ -6132,7 +6132,7 @@ static int enable_sysv_units(const char *verb, char **args) {
if (j < 0)
return j;
if (streq(verb, "is-enabled")) {
if (j == 0) {
if (j == EXIT_SUCCESS) {
if (!arg_quiet)
puts("enabled");
r = 1;
@ -6141,7 +6141,7 @@ static int enable_sysv_units(const char *verb, char **args) {
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)