From 4d3c8f6a389beab655f04f2bdd29a623d540a670 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Mon, 18 Jan 2016 22:12:07 +0000 Subject: [PATCH] Import misc.c,v 1.46 from OpenBSD (by espie@) Yet another missed ferror call --- usr.bin/m4/misc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/m4/misc.c b/usr.bin/m4/misc.c index eeca68e643c1..aeafea98f35d 100644 --- a/usr.bin/m4/misc.c +++ b/usr.bin/m4/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.45 2014/12/21 09:33:12 espie Exp $ */ +/* $OpenBSD: misc.c,v 1.46 2015/12/07 14:12:46 espie Exp $ */ /* $NetBSD: misc.c,v 1.6 1995/09/28 05:37:41 tls Exp $ */ /* @@ -424,6 +424,8 @@ do_emit_synchline(void) void release_input(struct input_file *f) { + if (ferror(f->file)) + errx(1, "Fatal error reading from %s\n", f->name); if (f->file != stdin) fclose(f->file); f->c = EOF;