aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/mknodes.c
diff options
context:
space:
mode:
authorMartin Cracauer <cracauer@FreeBSD.org>1999-11-29 19:11:01 +0000
committerMartin Cracauer <cracauer@FreeBSD.org>1999-11-29 19:11:01 +0000
commit6c48b6cf75960ede12a39f91a6c87ad709c6c47e (patch)
treefe2418bc458916f4034cdf37c5721762619e7404 /bin/sh/mknodes.c
parent886530ab78a8ea94d73a77505986d3ca7a5dae09 (diff)
Notes
Diffstat (limited to 'bin/sh/mknodes.c')
-rw-r--r--bin/sh/mknodes.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/sh/mknodes.c b/bin/sh/mknodes.c
index 615668b3733ab..007cb3247b2f0 100644
--- a/bin/sh/mknodes.c
+++ b/bin/sh/mknodes.c
@@ -56,6 +56,7 @@ static const char rcsid[] =
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <errno.h>
#ifdef __STDC__
#include <stdarg.h>
#else
@@ -123,7 +124,7 @@ main(argc, argv)
if (argc != 3)
error("usage: mknodes file");
if ((infp = fopen(argv[1], "r")) == NULL)
- error("Can't open %s", argv[1]);
+ error("Can't open %s: %s", argv[1], strerror(errno));
while (readline()) {
if (line[0] == ' ' || line[0] == '\t')
parsefield();
@@ -232,9 +233,9 @@ output(file)
char *p;
if ((patfile = fopen(file, "r")) == NULL)
- error("Can't open %s", file);
+ error("Can't open %s: %s", file, strerror(errno));
if ((hfile = fopen("nodes.h", "w")) == NULL)
- error("Can't create nodes.h");
+ error("Can't create nodes.h: %s", strerror(errno));
if ((cfile = fopen("nodes.c", "w")) == NULL)
error("Can't create nodes.c");
fputs(writer, hfile);