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'

Obtained from:	NetBSD (rev. 1.8)
MFC After:	1 week (if re@ would have approved this)
This commit is contained in:
delphij 2005-03-03 02:17:20 +00:00
parent 29c3c0268c
commit 3ec33a490c

View File

@ -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.
@ -533,13 +533,13 @@ makelist(struct listhead *head, enum listtype type, char *src)
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: