From b664903c396f76cbe4618d3be8d01871f46c543d Mon Sep 17 00:00:00 2001 From: dholland Date: Mon, 2 Mar 2009 06:44:22 +0000 Subject: Use err(3) and errx(3), not perror and fprintf to stderr. From OpenBSD. --- sail/dr_main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sail') 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 #include #include #include @@ -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; -- cgit v1.2.3-56-ge451