-/* $NetBSD: dr_main.c,v 1.8 2001/01/04 01:53:24 jwise Exp $ */
+/* $NetBSD: dr_main.c,v 1.14 2009/03/14 19:36:42 dholland Exp $ */
/*
* Copyright (c) 1983, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#if 0
static char sccsid[] = "@(#)dr_main.c 8.2 (Berkeley) 4/16/94";
#else
-__RCSID("$NetBSD: dr_main.c,v 1.8 2001/01/04 01:53:24 jwise Exp $");
+__RCSID("$NetBSD: dr_main.c,v 1.14 2009/03/14 19:36:42 dholland Exp $");
#endif
#endif /* not lint */
-#include "driver.h"
+#include <err.h>
+#include <signal.h>
+#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-
-int dr_main(void);
+#include "extern.h"
+#include "driver.h"
int
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;
foreachship(sp) {
if (sp->file == NULL &&
- (sp->file = (struct File *)calloc(1, sizeof (struct File))) == NULL) {
+ (sp->file = calloc(1, sizeof (struct File))) == NULL) {
fprintf(stderr, "DRIVER: Out of memory.\n");
exit(1);
}