summaryrefslogtreecommitdiffstats
path: root/text-utils
diff options
context:
space:
mode:
authorKarel Zak2019-06-13 12:59:39 +0200
committerKarel Zak2019-06-13 12:59:39 +0200
commit303ff21ea72645fff4ee726c8b41c7bc34333c96 (patch)
treef2454543e3bf1049041f9f6f5439dac1e1407058 /text-utils
parentfindmnt: (verify) ignore passno for XFS (diff)
downloadkernel-qcow2-util-linux-303ff21ea72645fff4ee726c8b41c7bc34333c96.tar.gz
kernel-qcow2-util-linux-303ff21ea72645fff4ee726c8b41c7bc34333c96.tar.xz
kernel-qcow2-util-linux-303ff21ea72645fff4ee726c8b41c7bc34333c96.zip
rev: be careful with close()
Addresses: https://github.com/karelzak/util-linux/issues/807 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'text-utils')
-rw-r--r--text-utils/rev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/text-utils/rev.c b/text-utils/rev.c
index 57624e6fb..ae9cae5dc 100644
--- a/text-utils/rev.c
+++ b/text-utils/rev.c
@@ -173,7 +173,8 @@ int main(int argc, char *argv[])
warn("%s", filename);
rval = EXIT_FAILURE;
}
- fclose(fp);
+ if (fp != stdin)
+ fclose(fp);
} while(*argv);
free(buf);