Add -g group to usage message.
Don't treat pointer as a boolean, but instead test it against NULL. Add warning for groups that don't exist Submitted by: ru
This commit is contained in:
parent
5f5aafe1fc
commit
003ff9433b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=73320
@ -126,8 +126,10 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
for (g = grouplist; g; g = g->next) {
|
for (g = grouplist; g; g = g->next) {
|
||||||
grp = getgrnam(g->name);
|
grp = getgrnam(g->name);
|
||||||
if (grp)
|
if (grp != NULL)
|
||||||
g->gid = grp->gr_gid;
|
g->gid = grp->gr_gid;
|
||||||
|
else
|
||||||
|
warnx("%s: no such group", g->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
makemsg(*argv);
|
makemsg(*argv);
|
||||||
@ -170,7 +172,7 @@ main(int argc, char *argv[])
|
|||||||
static void
|
static void
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
(void)fprintf(stderr, "usage: wall [file]\n");
|
(void)fprintf(stderr, "usage: wall [-g group] [file]\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user