summaryrefslogtreecommitdiffstats
path: root/text-utils/rev.c
diff options
context:
space:
mode:
authorSami Kerola2013-06-02 19:51:18 +0200
committerKarel Zak2013-06-07 12:24:49 +0200
commit67c47dff7a783df15986ee2c49231e0d905a89d0 (patch)
treee0a3b1e9aa5194432f2c67670b25196aab354219 /text-utils/rev.c
parentrev: simplify new line detection and impossible test (diff)
downloadkernel-qcow2-util-linux-67c47dff7a783df15986ee2c49231e0d905a89d0.tar.gz
kernel-qcow2-util-linux-67c47dff7a783df15986ee2c49231e0d905a89d0.tar.xz
kernel-qcow2-util-linux-67c47dff7a783df15986ee2c49231e0d905a89d0.zip
rev: reduce stream checking when closing read-only file descriptor
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'text-utils/rev.c')
-rw-r--r--text-utils/rev.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/text-utils/rev.c b/text-utils/rev.c
index 1665772b2..1c440366c 100644
--- a/text-utils/rev.c
+++ b/text-utils/rev.c
@@ -161,14 +161,11 @@ int main(int argc, char *argv[])
if (!feof(fp))
putwchar('\n');
}
-
- fflush(fp);
if (ferror(fp)) {
warn("%s", filename);
rval = EXIT_FAILURE;
}
- if (fclose(fp))
- rval = EXIT_FAILURE;
+ fclose(fp);
} while(*argv);
free(buf);