diff options
Diffstat (limited to 'libbb/fclose_nonstdin.c')
-rw-r--r-- | libbb/fclose_nonstdin.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libbb/fclose_nonstdin.c b/libbb/fclose_nonstdin.c index 5ce9d5b48..1b1441347 100644 --- a/libbb/fclose_nonstdin.c +++ b/libbb/fclose_nonstdin.c | |||
@@ -18,7 +18,8 @@ int FAST_FUNC fclose_if_not_stdin(FILE *f) | |||
18 | { | 18 | { |
19 | /* Some more paranoid applets want ferror() check too */ | 19 | /* Some more paranoid applets want ferror() check too */ |
20 | int r = ferror(f); /* NB: does NOT set errno! */ | 20 | int r = ferror(f); /* NB: does NOT set errno! */ |
21 | if (r) errno = EIO; /* so we'll help it */ | 21 | if (r) |
22 | errno = EIO; /* so we'll help it */ | ||
22 | if (f != stdin) | 23 | if (f != stdin) |
23 | return (r | fclose(f)); /* fclose does set errno on error */ | 24 | return (r | fclose(f)); /* fclose does set errno on error */ |
24 | return r; | 25 | return r; |