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>
This commit is contained in:
Denys Vlasenko 2021-06-18 00:32:29 +02:00
parent 4d16161797
commit 25fe2d50bd

View File

@ -357,6 +357,7 @@ static NOINLINE int next(priv_dumper_t *dumper)
if (!freopen(fname, "r", stdin)) {
bb_simple_perror_msg(fname);
dumper->exitval = 1;
dumper->next__done = 1;
continue;
}
}