summaryrefslogtreecommitdiffstats
path: root/phantasia/misc.c
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>2004-01-01 16:03:46 +0000
committerjsm <jsm@NetBSD.org>2004-01-01 16:03:46 +0000
commitb7a44a904f68d5a88886d63c2abc4cb42f2ac56c (patch)
tree38754a6fd711e89476e4f7541b91dd49ace527d6 /phantasia/misc.c
parente404ad4403123e9253916916a4ec87e4fc5c11b8 (diff)
downloadbsdgames-darwin-b7a44a904f68d5a88886d63c2abc4cb42f2ac56c.tar.gz
bsdgames-darwin-b7a44a904f68d5a88886d63c2abc4cb42f2ac56c.tar.zst
bsdgames-darwin-b7a44a904f68d5a88886d63c2abc4cb42f2ac56c.zip
When cleaning up, only close files that have been opened successfully.
When reporting errors for failing to open files, give error text rather than errno number. Patch from Joey Hess <joey@kitenet.net> for Debian bug 187251 from Mikael Hedin <micce@debian.org>.
Diffstat (limited to 'phantasia/misc.c')
-rw-r--r--phantasia/misc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/phantasia/misc.c b/phantasia/misc.c
index e195e4d3..4dc71b37 100644
--- a/phantasia/misc.c
+++ b/phantasia/misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.9 2003/05/08 13:03:49 wiz Exp $ */
+/* $NetBSD: misc.c,v 1.10 2004/01/01 16:03:46 jsm Exp $ */
/*
* misc.c Phantasia miscellaneous support routines
@@ -945,7 +945,7 @@ error(whichfile)
} else
funcp = printf;
- (*funcp) ("An unrecoverable error has occurred reading %s. (errno = %d)\n", whichfile, errno);
+ (*funcp) ("An unrecoverable error has occurred reading %s. (%s)\n", whichfile, strerror(errno));
(*funcp) ("Please run 'setup' to determine the problem.\n");
cleanup(TRUE);
/* NOTREACHED */