summaryrefslogtreecommitdiffstats
path: root/procd.c
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-10-02 19:39:56 +0200
committerJohn Crispin <blogic@openwrt.org>2014-10-02 19:49:05 +0200
commit49522abb5adebeedc25f7eb7e152c308ef04b32d (patch)
treee2e51be0297e5205d7c21ded376812533fa97bac /procd.c
parent542c5374259fa5a4c4d009efd6b23b46d51cba15 (diff)
downloadunitd-49522abb5adebeedc25f7eb7e152c308ef04b32d.tar
unitd-49522abb5adebeedc25f7eb7e152c308ef04b32d.zip
make procd handle ctrl+alt+del
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'procd.c')
-rw-r--r--procd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/procd.c b/procd.c
index ad80284..f5640c3 100644
--- a/procd.c
+++ b/procd.c
@@ -15,6 +15,7 @@
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/reboot.h>
#include <unistd.h>
#include <getopt.h>
@@ -69,6 +70,10 @@ int main(int argc, char **argv)
else
procd_state_next();
uloop_run();
+ uloop_done();
+
+ if (getpid() == 1)
+ procd_shutdown(RB_AUTOBOOT);
return 0;
}