cat: return error if file is not readable
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
This commit is contained in:
parent
63e01b4969
commit
a9675ec67c
|
@ -57,6 +57,7 @@ static int do_cat(cmd_tbl_t *cmdtp, int argc, char *argv[])
|
|||
while (args < argc) {
|
||||
fd = open(argv[args], O_RDONLY);
|
||||
if (fd < 0) {
|
||||
err = 1;
|
||||
printf("could not open %s: %s\n", argv[args], errno_str());
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue