Allow initial services to be specified on command-line on non-Linux OS.
authorDavin McCall <davmac@davmac.org>
Sun, 11 Feb 2018 13:05:44 +0000 (13:05 +0000)
committerDavin McCall <davmac@davmac.org>
Sun, 11 Feb 2018 13:05:44 +0000 (13:05 +0000)
src/dinit.cc

index 67474eb4706d897436f142140dd07e3031ffa8c5..247937fd0b2470221e2c0b1f2c505e467105758e 100644 (file)
@@ -227,6 +227,8 @@ int dinit_main(int argc, char **argv)
             if (! am_system_init || strcmp(argv[i], "auto") != 0) {
                 services_to_start.push_back(argv[i]);
             }
+#else
+            services_to_start.push_back(argv[i]);
 #endif
         }
       }
@@ -330,8 +332,8 @@ int dinit_main(int argc, char **argv)
 #if defined(__FreeBSD__) || defined(__DragonFly__)
     // Documentation (man page) for this kind of sucks. PROC_REAP_ACQUIRE "acquires the reaper status for
     // the current process" but does that mean the first two arguments still need valid values to be
-    // supplied? We'll play itself and explicitly target our own process:
-    procctl(P_PID, getpid(), PROC_REAP_ACQUIRE);
+    // supplied? We'll play it safe and explicitly target our own process:
+    procctl(P_PID, getpid(), PROC_REAP_ACQUIRE, NULL);
 #endif
     
     log_flush_timer.add_timer(event_loop, dasynq::clock_type::MONOTONIC);