diff options
author | H. Peter Anvin <hpa@zytor.com> | 2006-06-21 09:48:53 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2006-06-21 09:48:53 -0700 |
commit | 79317ba49e3f83d40f37b59fcdd5bd7c7635ee32 (patch) | |
tree | ebd435c0cddc7e72547b098f13b89132cf09e7ec | |
parent | 4942c6734827b57155376c337366c557a9692337 (diff) | |
download | linux-2.6-klibc-79317ba49e3f83d40f37b59fcdd5bd7c7635ee32.tar.gz |
[klibc] Clean up the halt program somewhat; add symlinks
Minor source cleanup in the halt program; add symlinks to
"reboot" and "poweroff".
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | usr/utils/Kbuild | 12 | ||||
-rw-r--r-- | usr/utils/halt.c | 6 |
2 files changed, 15 insertions, 3 deletions
diff --git a/usr/utils/Kbuild b/usr/utils/Kbuild index f760a6b0dc016..b3b8d8a18da2c 100644 --- a/usr/utils/Kbuild +++ b/usr/utils/Kbuild @@ -4,7 +4,7 @@ progs := chroot dd mkdir mkfifo mount pivot_root umount progs += true false sleep ln nuke minips cat -progs += insmod uname +progs += insmod uname halt static-y := $(addprefix static/, $(progs)) shared-y := $(addprefix shared/, $(progs)) @@ -42,6 +42,16 @@ static/insmod-y := insmod.o shared/insmod-y := insmod.o static/uname-y := uname.o shared/uname-y := uname.o +static/halt-y := halt.o +shared/halt-y := halt.o + +# Additionally linked targets +always := static/reboot static/poweroff shared/reboot shared/poweroff + +$(obj)/static/reboot $(obj)/static/poweroff: $(obj)/static/halt + $(call cmd,ln) +$(obj)/shared/reboot $(obj)/shared/poweroff: $(obj)/shared/halt + $(call cmd,ln) # Clean deletes the static and shared dir clean-dirs := static shared diff --git a/usr/utils/halt.c b/usr/utils/halt.c index 77ca72d07a1d0..a6656b5c2209c 100644 --- a/usr/utils/halt.c +++ b/usr/utils/halt.c @@ -1,12 +1,14 @@ +#include <stdlib.h> #include <unistd.h> #include <signal.h> #include <sys/reboot.h> +#include <klibc/compiler.h> -static volatile void usage() +static __noreturn usage(void) { static char mesg[] = "Usage: {halt|reboot|poweroff} [-n]\n"; write(2, mesg, sizeof(mesg) - 1); - _exit(1); + exit(1); } int main(int argc, char *argv[]) |