9
0
Fork 0

cat: return error if file is not readable

Signed-off-by: Sascha Hauer <sha@pengutronix.de>
This commit is contained in:
Sascha Hauer 2009-10-19 07:54:33 +02:00 committed by Sascha Hauer
parent 63e01b4969
commit a9675ec67c
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}