mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-26 10:03:40 +03:00
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:
parent
d2e0ac3d1e
commit
b4a343112e
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user