summaryrefslogtreecommitdiff
path: root/src/init/s6-linux-init-telinit.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-04-26 15:52:54 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-04-26 15:52:54 +0000
commit1bfba3b0be32306b078f5ee527b864e758b2c77b (patch)
tree155db6f3c01becd24d422a2e55582e222ad6a89e /src/init/s6-linux-init-telinit.c
parent9e6d0f168bf59df9cd829d6ebe63fb08ea9ae01e (diff)
downloads6-linux-init-1bfba3b0be32306b078f5ee527b864e758b2c77b.tar.xz
Make a single hpr. Full doc, first draft.
Diffstat (limited to 'src/init/s6-linux-init-telinit.c')
-rw-r--r--src/init/s6-linux-init-telinit.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/init/s6-linux-init-telinit.c b/src/init/s6-linux-init-telinit.c
index 8678709..42441d6 100644
--- a/src/init/s6-linux-init-telinit.c
+++ b/src/init/s6-linux-init-telinit.c
@@ -24,7 +24,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
subgetopt_t l = SUBGETOPT_ZERO ;
for (;;)
{
- int opt = subgetopt_r(argc, argv, "c:p:s:m:d:", &l) ;
+ int opt = subgetopt_r(argc, argv, "c:p:s:m:d:D:", &l) ;
if (opt == -1) break ;
switch (opt)
{
@@ -32,7 +32,8 @@ int main (int argc, char const *const *argv, char const *const *envp)
case 'p' :
case 's' :
case 'm' :
- case 'd' : break ;
+ case 'd' :
+ case 'D' : break ;
default : dieusage() ;
}
}
@@ -63,9 +64,10 @@ int main (int argc, char const *const *argv, char const *const *envp)
fmt[uint_fmt(fmt, WEXITSTATUS(wstat))] = 0 ;
strerr_dief3x(wait_estatus(wstat), newargv[0], " died with exitcode ", fmt) ;
}
-
- newargv[0] = argv[0][0] == '6' ? S6_LINUX_INIT_BINPREFIX "reboot" : S6_LINUX_INIT_BINPREFIX "poweroff" ;
- newargv[1] = 0 ;
+
+ newargv[0] = S6_LINUX_INIT_BINPREFIX "s6-linux-init-hpr" ;
+ newargv[1] = argv[0][0] == '6' ? "-r" : "-p" ;
+ newargv[2] = 0 ;
}
xpathexec_run(newargv[0], newargv, envp) ;