summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/lpq
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/lpq
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/lpq')
-rw-r--r--usr.sbin/lpr/lpq/lpq.16
-rw-r--r--usr.sbin/lpr/lpq/lpq.c13
2 files changed, 9 insertions, 10 deletions
diff --git a/usr.sbin/lpr/lpq/lpq.1 b/usr.sbin/lpr/lpq/lpq.1
index 200f60d..04ecdad 100644
--- a/usr.sbin/lpr/lpq/lpq.1
+++ b/usr.sbin/lpr/lpq/lpq.1
@@ -75,7 +75,7 @@ rather than just the specified printer.
.Pp
For each job submitted (i.e. invocation of
.Xr lpr 1 )
-.Nm lpq
+.Nm
reports the user's name, current rank in the queue, the
names of files comprising the job, the job identifier (a number which
may be supplied to
@@ -93,7 +93,7 @@ is used as a sink in a pipeline) in which case the file
is indicated as ``(standard input)''.
.Pp
If
-.Nm lpq
+.Nm
warns that there is no daemon present (i.e. due to some malfunction),
the
.Xr lpc 8
@@ -127,7 +127,7 @@ appeared in
.Bx 3 .
.Sh BUGS
Due to the dynamic nature of the information in the spooling directory
-.Nm lpq
+.Nm
may report unreliably.
Output formatting is sensitive to the line length of the terminal;
this can results in widely spaced columns.
diff --git a/usr.sbin/lpr/lpq/lpq.c b/usr.sbin/lpr/lpq/lpq.c
index 56705bc..9dc9c8a 100644
--- a/usr.sbin/lpr/lpq/lpq.c
+++ b/usr.sbin/lpr/lpq/lpq.c
@@ -72,7 +72,7 @@ int users; /* # of users in user array */
uid_t uid, euid;
static int ckqueue __P((char *));
-void usage __P((void));
+static void usage __P((void));
int
main(argc, argv)
@@ -88,10 +88,8 @@ main(argc, argv)
uid = getuid();
seteuid(uid);
name = *argv;
- if (gethostname(host, sizeof(host))) {
- perror("lpq: gethostname");
- exit(1);
- }
+ if (gethostname(host, sizeof(host)))
+ err(1, "gethostname");
openlog("lpd", 0, LOG_LPR);
aflag = lflag = 0;
@@ -170,9 +168,10 @@ ckqueue(cap)
return (0);
}
-void
+static void
usage()
{
- puts("usage: lpq [-a] [-l] [-Pprinter] [user ...] [job ...]");
+ fprintf(stderr,
+ "usage: lpq [-a] [-l] [-Pprinter] [user ...] [job ...]\n");
exit(1);
}
OpenPOWER on IntegriCloud