summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2015-12-05 18:31:18 +0000
committerMarc Espie <espie@cvs.openbsd.org>2015-12-05 18:31:18 +0000
commitd68eb0c43c9011470ea5a0571376c43201aa8951 (patch)
treeaf3ff42f66f7777e32a831b8b67b063d394889cc /usr.bin/make
parent4e7e1e4fb3fc5c45f8846208e69e51b62fc353d9 (diff)
yet another feof check, just to be sure.
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/lowparse.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/make/lowparse.c b/usr.bin/make/lowparse.c
index e189fdd1546..51d5fcd9afb 100644
--- a/usr.bin/make/lowparse.c
+++ b/usr.bin/make/lowparse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lowparse.c,v 1.33 2014/11/03 12:48:37 espie Exp $ */
+/* $OpenBSD: lowparse.c,v 1.34 2015/12/05 18:31:17 espie Exp $ */
/* low-level parsing functions. */
@@ -165,8 +165,12 @@ new_input_file(const char *name, FILE *stream)
static void
free_input_stream(struct input_stream *istream)
{
- if (istream->F && fileno(istream->F) != STDIN_FILENO)
- (void)fclose(istream->F);
+ if (istream->F) {
+ if (ferror(istream->F))
+ Parse_Error(PARSE_FATAL, "Read error");
+ if (fileno(istream->F) != STDIN_FILENO)
+ (void)fclose(istream->F);
+ }
free(istream->str);
/* Note we can't free the file names, as they are embedded in GN
* for error reports. */