diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-08-31 21:05:54 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-08-31 21:05:54 +0200 |
commit | 22f4096ca96acd504ac74e7dfad96f07edb6da51 (patch) | |
tree | ebe2bb84f85e0abd8abb508fa91e2c3165bc4ce4 /src/remount-api-vfs.c | |
parent | f73e33d9ecdd5f97f31a3efcca254519eef5b7ea (diff) |
systemctl: rework exit codes for all utility programs to follow LSB or other standards
Diffstat (limited to 'src/remount-api-vfs.c')
-rw-r--r-- | src/remount-api-vfs.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/remount-api-vfs.c b/src/remount-api-vfs.c index d51a584f2f..8cdf7e8758 100644 --- a/src/remount-api-vfs.c +++ b/src/remount-api-vfs.c @@ -37,14 +37,14 @@ * respected */ int main(int argc, char *argv[]) { - int ret = 1; + int ret = EXIT_FAILURE; FILE *f = NULL; struct mntent* me; Hashmap *pids = NULL; if (argc > 1) { log_error("This program takes no argument."); - return 1; + return EXIT_FAILURE; } log_set_target(LOG_TARGET_SYSLOG_OR_KMSG); @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) { goto finish; } - ret = 0; + ret = EXIT_SUCCESS; while ((me = getmntent(f))) { pid_t pid; @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { execv("/bin/mount", (char **) arguments); log_error("Failed to execute /bin/mount: %m"); - _exit(1); + _exit(EXIT_FAILURE); } /* Parent */ @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) { if ((k = hashmap_put(pids, UINT_TO_PTR(pid), s)) < 0) { log_error("Failed to add PID to set: %s", strerror(-k)); - ret = 1; + ret = EXIT_FAILURE; continue; } } @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) { continue; log_error("waitid() failed: %m"); - ret = 1; + ret = EXIT_FAILURE; break; } @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) { else log_error("/bin/mount for %s terminated by signal %s.", s, signal_to_string(si.si_status)); - ret = 1; + ret = EXIT_FAILURE; } free(s); |