summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/lpc
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-09-24 06:48:24 +0000
committercharnier <charnier@FreeBSD.org>1997-09-24 06:48:24 +0000
commit49a43f1c40cff330447553c74983f50c305a90bd (patch)
tree2461a8278a1795e3f8aa616ff0029567b021f873 /usr.sbin/lpr/lpc
parent8acbd05f99be0b83f71366e26584715af13f0872 (diff)
downloadFreeBSD-src-49a43f1c40cff330447553c74983f50c305a90bd.zip
FreeBSD-src-49a43f1c40cff330447553c74983f50c305a90bd.tar.gz
Use err(3). Add usage(). Various fixes in man pages.
Diffstat (limited to 'usr.sbin/lpr/lpc')
-rw-r--r--usr.sbin/lpr/lpc/lpc.86
-rw-r--r--usr.sbin/lpr/lpc/lpc.c27
2 files changed, 17 insertions, 16 deletions
diff --git a/usr.sbin/lpr/lpc/lpc.8 b/usr.sbin/lpr/lpc/lpc.8
index ce0f451..b3a0c52 100644
--- a/usr.sbin/lpr/lpc/lpc.8
+++ b/usr.sbin/lpr/lpc/lpc.8
@@ -64,14 +64,14 @@ spooling queues and printer daemons.
.El
.Pp
Without any arguments,
-.Nm lpc
+.Nm
will prompt for commands from the standard input.
If arguments are supplied,
-.Nm lpc
+.Nm
interprets the first argument as a command and the remaining
arguments as parameters to the command. The standard input
may be redirected causing
-.Nm lpc
+.Nm
to read commands from file.
Commands may be abbreviated;
the following is the list of recognized commands.
diff --git a/usr.sbin/lpr/lpc/lpc.c b/usr.sbin/lpr/lpc/lpc.c
index 353d7cb..bb07d46 100644
--- a/usr.sbin/lpr/lpc/lpc.c
+++ b/usr.sbin/lpr/lpc/lpc.c
@@ -33,27 +33,31 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
+#if 0
static char sccsid[] = "@(#)lpc.c 8.3 (Berkeley) 4/28/95";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
+#include <ctype.h>
#include <dirent.h>
-#include <signal.h>
+#include <grp.h>
#include <setjmp.h>
-#include <syslog.h>
-#include <unistd.h>
-#include <stdlib.h>
+#include <signal.h>
#include <stdio.h>
-#include <ctype.h>
+#include <stdlib.h>
+#include <syslog.h>
#include <string.h>
-#include <grp.h>
+#include <unistd.h>
#include <sys/param.h>
#include "lp.h"
#include "lpc.h"
@@ -304,14 +308,11 @@ ingroup(grname)
if (gptr == NULL) {
if ((gptr = getgrnam(grname)) == NULL) {
- fprintf(stderr, "Warning: unknown group '%s'\n",
- grname);
+ warnx("warning: unknown group '%s'", grname);
return(0);
}
- if (getgroups(NGROUPS, groups) < 0) {
- perror("getgroups");
- exit(1);
- }
+ if (getgroups(NGROUPS, groups) < 0)
+ err(1, "getgroups");
}
gid = gptr->gr_gid;
for (i = 0; i < NGROUPS; i++)
OpenPOWER on IntegriCloud