=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/lowparse.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- src/usr.bin/make/lowparse.c 2014/11/03 12:48:37 1.33 +++ src/usr.bin/make/lowparse.c 2015/12/05 18:31:17 1.34 @@ -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 @@ 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. */