Don't use perror(); use err/warn instead.
Suggested by diffing against OpenBSD.
This commit is contained in:
parent
98ff506f59
commit
0419d05bfc
@ -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++)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user