chiark / gitweb /
mount-setup: properly show NULL mount options
[elogind.git] / main.c
diff --git a/main.c b/main.c
index 712c79728383a8002832d506e7fe1ab55f1ff339..ea001b18b0266fa92d1c9c38728d17e56cbe3785 100644 (file)
--- a/main.c
+++ b/main.c
@@ -247,7 +247,8 @@ int main(int argc, char *argv[]) {
 
         /* Mount /proc, /sys and friends, so that /proc/cmdline and
          * /proc/$PID/fd is available. */
-        mount_setup();
+        if (mount_setup() < 0)
+                goto finish;
 
         /* Reset all signal handlers. */
         assert_se(reset_all_signal_handlers() == 0);
@@ -271,6 +272,9 @@ int main(int argc, char *argv[]) {
 
         assert_se(action == ACTION_RUN || action == ACTION_TEST);
 
+        /* Set up PATH unless it is already set */
+        setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", false);
+
         /* Move out of the way, so that we won't block unmounts */
         assert_se(chdir("/")  == 0);