summaryrefslogtreecommitdiffstats
path: root/commands/cat.c
diff options
context:
space:
mode:
authorSascha Hauer <sha@pengutronix.de>2009-10-19 07:54:33 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2009-10-19 10:18:52 +0200
commita9675ec67c4657993962529d4e7d236bb4481154 (patch)
tree3f52e949cc04af76ce94da531570bd779a39b9c1 /commands/cat.c
parent63e01b4969c9eef70b45df279f43a786b0cb2c09 (diff)
downloadbarebox-a9675ec67c4657993962529d4e7d236bb4481154.tar.gz
cat: return error if file is not readable
Signed-off-by: Sascha Hauer <sha@pengutronix.de>
Diffstat (limited to 'commands/cat.c')
-rw-r--r--commands/cat.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/commands/cat.c b/commands/cat.c
index d6f9b7a..da34996 100644
--- a/commands/cat.c
+++ b/commands/cat.c
@@ -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;
}