summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/common_source/startdaemon.c
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/startdaemon.c
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/startdaemon.c')
-rw-r--r--usr.sbin/lpr/common_source/startdaemon.c23
1 files changed, 9 insertions, 14 deletions
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