diff options
author | 2001-12-06 03:12:30 +0000 | |
---|---|---|
committer | 2001-12-06 03:12:30 +0000 | |
commit | 222c0752cf9cad087f625780525f33075ede6084 (patch) | |
tree | 730fb8450de0f8060ca3e3ce494592db88b988f7 /usr.sbin/lpr/common_source/startdaemon.c | |
parent | A FILE * is not a file name, dammit. (diff) | |
download | wireguard-openbsd-222c0752cf9cad087f625780525f33075ede6084.tar.xz wireguard-openbsd-222c0752cf9cad087f625780525f33075ede6084.zip |
use err/warn and friends instead of printf/exit.
also, remove fatal2() which is just errx anyway.
millert@ ok
Diffstat (limited to 'usr.sbin/lpr/common_source/startdaemon.c')
-rw-r--r-- | usr.sbin/lpr/common_source/startdaemon.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/usr.sbin/lpr/common_source/startdaemon.c b/usr.sbin/lpr/common_source/startdaemon.c index 07c376943a2..971c6482a9a 100644 --- a/usr.sbin/lpr/common_source/startdaemon.c +++ b/usr.sbin/lpr/common_source/startdaemon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: startdaemon.c,v 1.5 2001/11/23 03:58:17 deraadt Exp $ */ +/* $OpenBSD: startdaemon.c,v 1.6 2001/12/06 03:12:30 ericj Exp $ */ /* * Copyright (c) 1983, 1993, 1994 @@ -37,7 +37,7 @@ #if 0 static const char sccsid[] = "@(#)startdaemon.c 8.2 (Berkeley) 4/17/94"; #else -static const char rcsid[] = "$OpenBSD: startdaemon.c,v 1.5 2001/11/23 03:58:17 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: startdaemon.c,v 1.6 2001/12/06 03:12:30 ericj Exp $"; #endif #endif /* not lint */ @@ -55,8 +55,6 @@ static const char rcsid[] = "$OpenBSD: startdaemon.c,v 1.5 2001/11/23 03:58:17 d extern uid_t uid, euid; -static void perr __P((char *)); - /* * Tell the printer daemon that there are new files in the spool directory. */ @@ -71,7 +69,7 @@ startdaemon(printer) s = socket(AF_UNIX, SOCK_STREAM, 0); if (s < 0) { - perr("socket"); + perror("socket"); return(0); } memset(&un, 0, sizeof(un)); @@ -91,7 +89,7 @@ startdaemon(printer) } siginterrupt(SIGINT, 0); seteuid(uid); - perr("connect"); + perror("connect"); (void) close(s); return(0); } @@ -105,7 +103,7 @@ startdaemon(printer) /* XXX atomicio inside siginterrupt? */ if (write(s, buf, n) != n) { - perr("write"); + perror("write"); (void) close(s); return(0); } @@ -122,12 +120,3 @@ startdaemon(printer) (void) close(s); return(0); } - -static void -perr(msg) - char *msg; -{ - extern char *name; - - (void)printf("%s: %s: %s\n", name, msg, strerror(errno)); -} |