diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-18 00:32:29 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-18 00:32:29 +0200 |
commit | 25fe2d50bd75097861db9eac8c8c9f238283ff5f (patch) | |
tree | b384270c881c164644a4ea1a9a641885e090e072 | |
parent | 4d1616179745ee3883a726aaf13468e9c44dff9e (diff) | |
download | busybox-w32-25fe2d50bd75097861db9eac8c8c9f238283ff5f.tar.gz busybox-w32-25fe2d50bd75097861db9eac8c8c9f238283ff5f.tar.bz2 busybox-w32-25fe2d50bd75097861db9eac8c8c9f238283ff5f.zip |
xxd: do not try reading from closed stdin when non-existent file is given
Was:
xxd: FILE: No such file or directory
xxd: FILE: Bad file descriptor
function old new delta
next 276 278 +2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libbb/dump.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libbb/dump.c b/libbb/dump.c index 8c2a370d0..9c16f1f94 100644 --- a/libbb/dump.c +++ b/libbb/dump.c | |||
@@ -357,6 +357,7 @@ static NOINLINE int next(priv_dumper_t *dumper) | |||
357 | if (!freopen(fname, "r", stdin)) { | 357 | if (!freopen(fname, "r", stdin)) { |
358 | bb_simple_perror_msg(fname); | 358 | bb_simple_perror_msg(fname); |
359 | dumper->exitval = 1; | 359 | dumper->exitval = 1; |
360 | dumper->next__done = 1; | ||
360 | continue; | 361 | continue; |
361 | } | 362 | } |
362 | } | 363 | } |