From 30feaa22dd68242100ef011b937589c5e7fe83be Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 13 May 2002 05:23:37 +0000 Subject: [PATCH] * kill.cc (usage): Show new options. Allow specification of output stream. (main): Implement 'h' option. --- winsup/utils/ChangeLog | 6 ++++++ winsup/utils/kill.cc | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index fb3f60f44..878480537 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,9 @@ +2002-05-13 Christopher Faylor + + * kill.cc (usage): Show new options. Allow specification of output + stream. + (main): Implement 'h' option. + 2002-05-13 Christopher Faylor * Makefile.in (kill.exe): Add as a specific target. diff --git a/winsup/utils/kill.cc b/winsup/utils/kill.cc index da1721f0e..6c72f053b 100644 --- a/winsup/utils/kill.cc +++ b/winsup/utils/kill.cc @@ -32,10 +32,11 @@ static char opts[] = "hl::fs:"; extern "C" const char *strsigno (int); static void -usage (void) +usage (FILE *where = stderr) { - fprintf (stderr, "Usage: kill [-sigN] pid1 [pid2 ...]\n"); - exit (1); + fputs ("usage: kill [-signal] [-s signal] pid1 [pid2 ...]\n" + " kill -l [signal]\n", where); + exit (where == stderr ? 1 : 0); } static int @@ -140,6 +141,9 @@ main (int argc, char **argv) case 'f': force = 1; break; + case 'h': + usage (stdout); + break; case '?': if (gotsig) usage ();