diff options
author | mrg <mrg@NetBSD.org> | 1996-08-15 03:53:24 +0000 |
---|---|---|
committer | mrg <mrg@NetBSD.org> | 1996-08-15 03:53:24 +0000 |
commit | 8abf9a302ad3cfee02d06e259308b014dc652f61 (patch) | |
tree | 127e2ac7c1ca7c490271f3467777a093d3c3f375 /larn/io.c | |
parent | 5907b84fc3b8d464ecedbc099bd1af93456a1c84 (diff) | |
download | bsdgames-darwin-8abf9a302ad3cfee02d06e259308b014dc652f61.tar.gz bsdgames-darwin-8abf9a302ad3cfee02d06e259308b014dc652f61.tar.zst bsdgames-darwin-8abf9a302ad3cfee02d06e259308b014dc652f61.zip |
print more informative error message. from kstailey (PR#2699)
Diffstat (limited to 'larn/io.c')
-rw-r--r-- | larn/io.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "$NetBSD: io.c,v 1.4 1995/04/24 12:23:57 cgd Exp $"; +static char rcsid[] = "$NetBSD: io.c,v 1.5 1996/08/15 03:53:24 mrg Exp $"; #endif /* not lint */ /* io.c Larn is copyrighted 1986 by Noah Morgan. @@ -61,6 +61,7 @@ static char rcsid[] = "$NetBSD: io.c,v 1.4 1995/04/24 12:23:57 cgd Exp $"; #include "header.h" #include <string.h> +#include <errno.h> #ifdef SYSV /* system III or system V */ #include <termio.h> @@ -458,7 +459,9 @@ lcreat(str) if (str==NULL) return(lfd=1); if ((lfd=creat(str,0644)) < 0) { - lfd=1; lprintf("error creating file <%s>\n",str); lflush(); return(-1); + lfd=1; lprintf("error creating file <%s>: %s\n",str, + strerror(errno)); + lflush(); return(-1); } return(lfd); } |