summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/common_source
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/common_source
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/common_source')
-rw-r--r--usr.sbin/lpr/common_source/recvjob.c12
-rw-r--r--usr.sbin/lpr/common_source/rmjob.c4
-rw-r--r--usr.sbin/lpr/common_source/startdaemon.c23
3 files changed, 21 insertions, 18 deletions
diff --git a/usr.sbin/lpr/common_source/recvjob.c b/usr.sbin/lpr/common_source/recvjob.c
index 6ed50c3..192d993 100644
--- a/usr.sbin/lpr/common_source/recvjob.c
+++ b/usr.sbin/lpr/common_source/recvjob.c
@@ -33,13 +33,17 @@
*/
#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[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
/*
@@ -146,7 +150,7 @@ readjob()
do {
if ((size = read(1, cp, 1)) != 1) {
if (size < 0)
- frecverr("%s: Lost connection",
+ frecverr("%s: lost connection",
printer);
return(nfiles);
}
@@ -243,7 +247,7 @@ readfile(file, size)
do {
j = read(1, cp, amt);
if (j <= 0)
- frecverr("Lost connection");
+ frecverr("lost connection");
amt -= j;
cp += j;
} while (amt > 0);
@@ -272,7 +276,7 @@ noresponse()
char resp;
if (read(1, &resp, 1) != 1)
- frecverr("Lost connection");
+ frecverr("lost connection");
if (resp == '\0')
return(0);
return(1);
diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c
index c44f172..32e13d4 100644
--- a/usr.sbin/lpr/common_source/rmjob.c
+++ b/usr.sbin/lpr/common_source/rmjob.c
@@ -32,7 +32,11 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)rmjob.c 8.2 (Berkeley) 4/28/95";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/param.h>
diff --git a/usr.sbin/lpr/common_source/startdaemon.c b/usr.sbin/lpr/common_source/startdaemon.c
index ca24c82..7f990b4 100644
--- a/usr.sbin/lpr/common_source/startdaemon.c
+++ b/usr.sbin/lpr/common_source/startdaemon.c
@@ -32,7 +32,11 @@
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)startdaemon.c 8.2 (Berkeley) 4/17/94";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
@@ -41,17 +45,15 @@ static char sccsid[] = "@(#)startdaemon.c 8.2 (Berkeley) 4/17/94";
#include <sys/un.h>
#include <dirent.h>
-#include <errno.h>
+#include <err.h>
#include <stdio.h>
-#include <unistd.h>
#include <string.h>
+#include <unistd.h>
#include "lp.h"
#include "pathnames.h"
extern uid_t uid, euid;
-static void perr __P((char *));
-
/*
* Tell the printer daemon that there are new files in the spool directory.
*/
@@ -66,7 +68,7 @@ startdaemon(printer)
s = socket(AF_UNIX, SOCK_STREAM, 0);
if (s < 0) {
- perr("socket");
+ warn("socket");
return(0);
}
memset(&un, 0, sizeof(un));
@@ -78,7 +80,7 @@ startdaemon(printer)
seteuid(euid);
if (connect(s, (struct sockaddr *)&un, SUN_LEN(&un)) < 0) {
seteuid(uid);
- perr("connect");
+ warn("connect");
(void) close(s);
return(0);
}
@@ -89,7 +91,7 @@ startdaemon(printer)
}
n = strlen(buf);
if (write(s, buf, n) != n) {
- perr("write");
+ warn("write");
(void) close(s);
return(0);
}
@@ -105,10 +107,3 @@ startdaemon(printer)
(void) close(s);
return(0);
}
-
-static void
-perr(msg)
- char *msg;
-{
- (void)printf("%s: %s: %s\n", name, msg, strerror(errno));
-}
OpenPOWER on IntegriCloud