X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fremount-api-vfs.c;h=5b1872833a5d5bc4e35ef95be85367fa908db53d;hp=d51a584f2f7ad24aeac52633bd6f06f36a959452;hb=89d471d55eadce53c5ad97e50dfaa0063c227d7e;hpb=449ddb2d23a63ca4c8cd70d13a070fba87c1fb30 diff --git a/src/remount-api-vfs.c b/src/remount-api-vfs.c index d51a584f2..5b1872833 100644 --- a/src/remount-api-vfs.c +++ b/src/remount-api-vfs.c @@ -31,20 +31,21 @@ #include "util.h" #include "set.h" #include "mount-setup.h" +#include "exit-status.h" /* Goes through /etc/fstab and remounts all API file systems, applying * options that are in /etc/fstab that systemd might not have * 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 +62,7 @@ int main(int argc, char *argv[]) { goto finish; } - ret = 0; + ret = EXIT_SUCCESS; while ((me = getmntent(f))) { pid_t pid; @@ -92,7 +93,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 +102,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 +118,7 @@ int main(int argc, char *argv[]) { continue; log_error("waitid() failed: %m"); - ret = 1; + ret = EXIT_FAILURE; break; } @@ -128,7 +129,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);