Use warn*(3).

This commit is contained in:
mycroft 1998-01-20 23:41:57 +00:00
parent bc0a5a65c3
commit 689db8fcc6

View File

@ -1,4 +1,4 @@
/* $NetBSD: reboot.c,v 1.17 1998/01/20 23:37:27 mycroft Exp $ */ /* $NetBSD: reboot.c,v 1.18 1998/01/20 23:41:57 mycroft Exp $ */
/* /*
* Copyright (c) 1980, 1986, 1993 * Copyright (c) 1980, 1986, 1993
@ -44,20 +44,21 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1993\n"
#if 0 #if 0
static char sccsid[] = "@(#)reboot.c 8.1 (Berkeley) 6/5/93"; static char sccsid[] = "@(#)reboot.c 8.1 (Berkeley) 6/5/93";
#else #else
__RCSID("$NetBSD: reboot.c,v 1.17 1998/01/20 23:37:27 mycroft Exp $"); __RCSID("$NetBSD: reboot.c,v 1.18 1998/01/20 23:41:57 mycroft Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
#include <sys/reboot.h> #include <sys/reboot.h>
#include <signal.h>
#include <pwd.h>
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <syslog.h> #include <pwd.h>
#include <unistd.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <syslog.h>
#include <unistd.h>
#include <util.h> #include <util.h>
int main __P((int, char *[])); int main __P((int, char *[]));
@ -169,8 +170,7 @@ main(argc, argv)
* single-user mode. * single-user mode.
*/ */
if (errno != ESRCH) { if (errno != ESRCH) {
(void)fprintf(stderr, "%s: SIGTERM processes: %s", warn("SIGTERM processes");
dohalt ? "halt" : "reboot", strerror(errno));
goto restart; goto restart;
} }
} }
@ -192,8 +192,7 @@ main(argc, argv)
goto restart; goto restart;
} }
if (i > 5) { if (i > 5) {
(void)fprintf(stderr, warnx("WARNING: some process(es) wouldn't die");
"WARNING: some process(es) wouldn't die\n");
break; break;
} }
(void)sleep(2 * i); (void)sleep(2 * i);