From 96cc79a5bfaeb22ba7da216fd548160ce418b13d Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 21 May 2015 23:34:03 +0100 Subject: [PATCH] kill: remove stdio --- Applications/util/kill.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Applications/util/kill.c b/Applications/util/kill.c index 87e1db83..f3cf9df9 100644 --- a/Applications/util/kill.c +++ b/Applications/util/kill.c @@ -2,7 +2,7 @@ * Permission is granted to use, distribute, or modify this source, * provided that this copyright notice remains intact. * - * Most simple built-in commands are here. + * Stripped of stdio usage Alan Cox, 2015 */ #include @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) int pid, sig = SIGTERM; if (argc < 2) { - fprintf(stderr, "usage: kill [-sig] pid ...\n"); + write(2, "usage: kill [-sig] pid ...\n", 27); return 0; } if (argv[1][0] == '-') { @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) while (isdigit(*cp)) sig = sig * 10 + *cp++ - '0'; if (*cp) { - fprintf(stderr, "kill: unknown signal\n"); + write(2, "kill: unknown signal\n", 21); return 1; } } @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) while (isdigit(*cp)) pid = pid * 10 + *cp++ - '0'; if (*cp) { - fprintf(stderr, "kill: non-numeric pid\n"); + write(1, "kill: non-numeric pid\n", 22); continue; } if (kill(pid, sig) < 0) { -- 2.34.1