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:
		@@ -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;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user