summaryrefslogtreecommitdiffstats
path: root/monop
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2008-02-19 09:30:26 +0000
committerdholland <dholland@NetBSD.org>2008-02-19 09:30:26 +0000
commit7b6be30c35ffc31d7abab3b759819288cda3cf45 (patch)
tree39451c5799a67a1357d413b6916f03b474152bca /monop
parentc32d69dfcb7efa4eca522acc7a276a8f987ffeab (diff)
downloadbsdgames-darwin-7b6be30c35ffc31d7abab3b759819288cda3cf45.tar.gz
bsdgames-darwin-7b6be30c35ffc31d7abab3b759819288cda3cf45.tar.zst
bsdgames-darwin-7b6be30c35ffc31d7abab3b759819288cda3cf45.zip
Don't use perror(); use err/warn instead.
Suggested by diffing against OpenBSD.
Diffstat (limited to 'monop')
-rw-r--r--monop/cards.c10
-rw-r--r--monop/execute.c11
2 files changed, 9 insertions, 12 deletions
diff --git a/monop/cards.c b/monop/cards.c
index e3778f02..4eee055b 100644
--- a/monop/cards.c
+++ b/monop/cards.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cards.c,v 1.15 2008/01/28 06:16:13 dholland Exp $ */
+/* $NetBSD: cards.c,v 1.16 2008/02/19 09:30:26 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: cards.c,v 1.15 2008/01/28 06:16:13 dholland Exp $");
+__RCSID("$NetBSD: cards.c,v 1.16 2008/02/19 09:30:26 dholland Exp $");
#endif
#endif /* not lint */
@@ -71,8 +71,7 @@ init_decks()
if ((deckf=fopen(cardfile, "r")) == NULL) {
file_err:
- perror(cardfile);
- exit(1);
+ err(1, "%s", cardfile);
}
/* read number of community chest cards... */
@@ -102,8 +101,7 @@ set_up(dp)
errx(1, "out of memory");
if (fread(dp->offsets, sizeof(off_t), dp->num_cards, deckf) !=
(unsigned) dp->num_cards) {
- perror(cardfile);
- exit(1);
+ err(1, "%s", cardfile);
}
/* convert offsets from big-endian byte order */
for (i = 0; i < dp->num_cards; i++)
diff --git a/monop/execute.c b/monop/execute.c
index 07dce323..72d04773 100644
--- a/monop/execute.c
+++ b/monop/execute.c
@@ -1,4 +1,4 @@
-/* $NetBSD: execute.c,v 1.12 2008/01/28 06:16:13 dholland Exp $ */
+/* $NetBSD: execute.c,v 1.13 2008/02/19 09:30:26 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)execute.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: execute.c,v 1.12 2008/01/28 06:16:13 dholland Exp $");
+__RCSID("$NetBSD: execute.c,v 1.13 2008/02/19 09:30:26 dholland Exp $");
#endif
#endif /* not lint */
@@ -197,7 +197,7 @@ save()
return;
if ((outf=creat(buf, 0644)) < 0) {
- perror(buf);
+ warn("%s", buf);
return;
}
printf("\"%s\" ", buf);
@@ -247,13 +247,12 @@ rest_f(file)
STAT sbuf;
if ((inf=open(file, O_RDONLY)) < 0) {
- perror(file);
+ warn("%s", file);
return FALSE;
}
printf("\"%s\" ", file);
if (fstat(inf, &sbuf) < 0) { /* get file stats */
- perror(file);
- exit(1);
+ err(1, "%s: fstat", file);
}
start = heapstart;
brk(end = start + sbuf.st_size);