Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/pkill If a user or group is not known, report the pr...



details:   https://anonhg.NetBSD.org/src/rev/1f4595ca634c
branches:  trunk
changeset: 574506:1f4595ca634c
user:      abs <abs%NetBSD.org@localhost>
date:      Wed Mar 02 15:31:44 2005 +0000

description:
If a user or group is not known, report the problem user/group, rather than
the first user/group. Caused huge fun in error messages from large script.
Old:    pgrep -u root,NoSuchUser,daemon -> pgrep: unknown user `root'
Now:    pgrep -u root,NoSuchUser,daemon -> pgrep: unknown user `NoSuchUser'

diffstat:

 usr.bin/pkill/pkill.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r a34857cce972 -r 1f4595ca634c usr.bin/pkill/pkill.c
--- a/usr.bin/pkill/pkill.c     Wed Mar 02 13:46:45 2005 +0000
+++ b/usr.bin/pkill/pkill.c     Wed Mar 02 15:31:44 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pkill.c,v 1.7 2004/02/15 17:03:30 soren Exp $  */
+/*     $NetBSD: pkill.c,v 1.8 2005/03/02 15:31:44 abs Exp $    */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: pkill.c,v 1.7 2004/02/15 17:03:30 soren Exp $");
+__RCSID("$NetBSD: pkill.c,v 1.8 2005/03/02 15:31:44 abs Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -494,13 +494,13 @@
                case LT_USER:
                        if ((pw = getpwnam(sp)) == NULL)
                                errx(STATUS_BADUSAGE, "unknown user `%s'",
-                                   optarg);
+                                   sp);
                        li->li_number = pw->pw_uid;
                        break;
                case LT_GROUP:
                        if ((gr = getgrnam(sp)) == NULL)
                                errx(STATUS_BADUSAGE, "unknown group `%s'",
-                                   optarg);
+                                   sp);
                        li->li_number = gr->gr_gid;
                        break;
                case LT_TTY:



Home | Main Index | Thread Index | Old Index