diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2016-09-10 13:42:04 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2016-09-10 13:42:04 +0000 |
commit | 5928bf00c094a250c3d9cc4346075cd65c87e865 (patch) | |
tree | d9d00749c1ea23c6df7af35be5517631830d1cb4 /src | |
parent | a19ce7bb451236b79ac79d7ffc8e8fa12323ea0d (diff) | |
download | s6-linux-utils-5928bf00c094a250c3d9cc4346075cd65c87e865.tar.xz |
Remove s6-halt, s6-poweroff and s6-reboot (moved to the s6-linux-init package)
Diffstat (limited to 'src')
-rw-r--r-- | src/minutils/deps-exe/s6-halt | 1 | ||||
-rw-r--r-- | src/minutils/deps-exe/s6-poweroff | 1 | ||||
-rw-r--r-- | src/minutils/deps-exe/s6-reboot | 1 | ||||
-rw-r--r-- | src/minutils/hpr.c | 44 | ||||
-rw-r--r-- | src/minutils/s6-halt.c | 7 | ||||
-rw-r--r-- | src/minutils/s6-poweroff.c | 7 | ||||
-rw-r--r-- | src/minutils/s6-reboot.c | 7 | ||||
-rw-r--r-- | src/minutils/s6ps_statparse.c | 3 |
8 files changed, 2 insertions, 69 deletions
diff --git a/src/minutils/deps-exe/s6-halt b/src/minutils/deps-exe/s6-halt deleted file mode 100644 index e7187fe..0000000 --- a/src/minutils/deps-exe/s6-halt +++ /dev/null @@ -1 +0,0 @@ --lskarnet diff --git a/src/minutils/deps-exe/s6-poweroff b/src/minutils/deps-exe/s6-poweroff deleted file mode 100644 index e7187fe..0000000 --- a/src/minutils/deps-exe/s6-poweroff +++ /dev/null @@ -1 +0,0 @@ --lskarnet diff --git a/src/minutils/deps-exe/s6-reboot b/src/minutils/deps-exe/s6-reboot deleted file mode 100644 index e7187fe..0000000 --- a/src/minutils/deps-exe/s6-reboot +++ /dev/null @@ -1 +0,0 @@ --lskarnet diff --git a/src/minutils/hpr.c b/src/minutils/hpr.c deleted file mode 100644 index 0e1c27a..0000000 --- a/src/minutils/hpr.c +++ /dev/null @@ -1,44 +0,0 @@ -/* ISC license. */ - -#include <unistd.h> -#include <signal.h> -#include <sys/reboot.h> -#include <skalibs/strerr2.h> -#include <skalibs/sgetopt.h> - -#define USAGE PROGNAME " [ -h | -p | -r ] [ -f ]" - -int main (int argc, char const *const *argv) -{ - int what = WHATDEFAULT ; - int force = 0 ; - PROG = PROGNAME ; - - { - subgetopt_t l = SUBGETOPT_ZERO ; - for (;;) - { - register int opt = subgetopt_r(argc, argv, "hprf", &l) ; - if (opt == -1) break ; - switch (opt) - { - case 'h' : what = 1 ; break ; - case 'p' : what = 2 ; break ; - case 'r' : what = 3 ; break ; - case 'f' : force = 1 ; break ; - default : strerr_dieusage(100, USAGE) ; - } - } - argc -= l.ind ; argv += l.ind ; - } - - if (force) - { - sync() ; - reboot(what == 3 ? RB_AUTOBOOT : what == 2 ? RB_POWER_OFF : RB_HALT_SYSTEM) ; - strerr_diefu1sys(111, "reboot()") ; - } - else if (kill(1, what == 3 ? SIGINT : what == 2 ? SIGUSR1 : SIGUSR2) < 0) - strerr_diefu1sys(111, "signal process 1") ; - return 0 ; -} diff --git a/src/minutils/s6-halt.c b/src/minutils/s6-halt.c deleted file mode 100644 index d758030..0000000 --- a/src/minutils/s6-halt.c +++ /dev/null @@ -1,7 +0,0 @@ -/* ISC license. */ - -#undef PROGNAME -#define PROGNAME "s6-halt" -#undef WHATDEFAULT -#define WHATDEFAULT 1 -#include "hpr.c" diff --git a/src/minutils/s6-poweroff.c b/src/minutils/s6-poweroff.c deleted file mode 100644 index f9f7747..0000000 --- a/src/minutils/s6-poweroff.c +++ /dev/null @@ -1,7 +0,0 @@ -/* ISC license. */ - -#undef PROGNAME -#define PROGNAME "s6-poweroff" -#undef WHATDEFAULT -#define WHATDEFAULT 2 -#include "hpr.c" diff --git a/src/minutils/s6-reboot.c b/src/minutils/s6-reboot.c deleted file mode 100644 index 0bf8785..0000000 --- a/src/minutils/s6-reboot.c +++ /dev/null @@ -1,7 +0,0 @@ -/* ISC license. */ - -#undef PROGNAME -#define PROGNAME "s6-reboot" -#undef WHATDEFAULT -#define WHATDEFAULT 3 -#include "hpr.c" diff --git a/src/minutils/s6ps_statparse.c b/src/minutils/s6ps_statparse.c index b5976a1..d8bc39e 100644 --- a/src/minutils/s6ps_statparse.c +++ b/src/minutils/s6ps_statparse.c @@ -149,7 +149,8 @@ int s6ps_statparse (pscan_t *p) if (pos + 1 > p->statlen) return 0 ; if (p->data.s[pos++] != ' ') return 0 ; w = (*scanfuncs[i])(p->data.s + pos, scanresults[i]) ; - if (!w) return 0 ; pos += w ; + if (!w) return 0 ; + pos += w ; } return 1 ; } |