If ferror is true, we must reset the error indicator. Submitted by: Liam J. Foy Index: src/usr.bin/rev/rev.c =================================================================== --- src/usr.bin/rev/rev.c (revision 117) +++ src/usr.bin/rev/rev.c (revision 118) @@ -103,6 +103,7 @@ } if (ferror(fp)) { warn("%s", filename); + clearerr(fp); rval = 1; } (void)fclose(fp);