diff options
Diffstat (limited to 'head.c')
-rw-r--r-- | head.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -22,7 +22,6 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <errno.h> | ||
26 | #include <stdio.h> | 25 | #include <stdio.h> |
27 | #include <getopt.h> | 26 | #include <getopt.h> |
28 | #include <stdlib.h> | 27 | #include <stdlib.h> |
@@ -82,10 +81,9 @@ int head_main(int argc, char **argv) | |||
82 | printf("==> %s <==\n", argv[optind]); | 81 | printf("==> %s <==\n", argv[optind]); |
83 | } | 82 | } |
84 | head(len, fp); | 83 | head(len, fp); |
85 | if (errno) { | 84 | if (ferror(fp)) { |
86 | perror_msg("%s", argv[optind]); | 85 | perror_msg("%s", argv[optind]); |
87 | status = EXIT_FAILURE; | 86 | status = EXIT_FAILURE; |
88 | errno = 0; | ||
89 | } | 87 | } |
90 | if (optind < argc - 1) | 88 | if (optind < argc - 1) |
91 | putchar('\n'); | 89 | putchar('\n'); |