diff options
author | dholland <dholland@NetBSD.org> | 2009-03-02 06:44:22 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2009-03-02 06:44:22 +0000 |
commit | b664903c396f76cbe4618d3be8d01871f46c543d (patch) | |
tree | 4d42e36a97d8a72da585433dc99117de1af09928 /sail | |
parent | b8313a402e72751bb0d6bed552f055d92fb21620 (diff) | |
download | bsdgames-darwin-b664903c396f76cbe4618d3be8d01871f46c543d.tar.gz bsdgames-darwin-b664903c396f76cbe4618d3be8d01871f46c543d.tar.zst bsdgames-darwin-b664903c396f76cbe4618d3be8d01871f46c543d.zip |
Use err(3) and errx(3), not perror and fprintf to stderr. From OpenBSD.
Diffstat (limited to 'sail')
-rw-r--r-- | sail/dr_main.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sail/dr_main.c b/sail/dr_main.c index 893a7702..f264b347 100644 --- a/sail/dr_main.c +++ b/sail/dr_main.c @@ -1,4 +1,4 @@ -/* $NetBSD: dr_main.c,v 1.12 2003/08/07 09:37:42 agc Exp $ */ +/* $NetBSD: dr_main.c,v 1.13 2009/03/02 06:44:22 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,10 +34,11 @@ #if 0 static char sccsid[] = "@(#)dr_main.c 8.2 (Berkeley) 4/16/94"; #else -__RCSID("$NetBSD: dr_main.c,v 1.12 2003/08/07 09:37:42 agc Exp $"); +__RCSID("$NetBSD: dr_main.c,v 1.13 2009/03/02 06:44:22 dholland Exp $"); #endif #endif /* not lint */ +#include <err.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> @@ -57,14 +58,12 @@ dr_main(void) signal(SIGQUIT, SIG_IGN); signal(SIGTSTP, SIG_IGN); if (game < 0 || game >= NSCENE) { - fprintf(stderr, "DRIVER: Bad game number %d\n", game); - exit(1); + errx(1, "driver: Bad game number %d", game); } cc = &scene[game]; ls = SHIP(cc->vessels); if (sync_open() < 0) { - perror("driver: syncfile"); - exit(1); + err(1, "driver: syncfile"); } for (n = 0; n < NNATION; n++) nat[n] = 0; |