summaryrefslogtreecommitdiffstats
path: root/commands/cat.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-14 14:44:29 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2007-07-14 14:44:29 +0200
commit41fd1f66259fae8b9cac58caf67a4908b78dd1f9 (patch)
tree0193f3fb83edaaaff509e9bee21b0c95dc0cc79c /commands/cat.c
parent828fe2d8e442741ad30a1cdc85b4ddf7b5125b5c (diff)
downloadbarebox-41fd1f66259fae8b9cac58caf67a4908b78dd1f9.tar.gz
add O_RDONLY flag to open() call
Diffstat (limited to 'commands/cat.c')
-rw-r--r--commands/cat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/commands/cat.c b/commands/cat.c
index b1b06e8..dd477c5 100644
--- a/commands/cat.c
+++ b/commands/cat.c
@@ -23,6 +23,7 @@
#include <common.h>
#include <command.h>
#include <fs.h>
+#include <fcntl.h>
#include <linux/ctype.h>
#include <errno.h>
#include <xfuncs.h>
@@ -44,7 +45,7 @@ static int do_cat(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
buf = xmalloc(1024);
while (args < argc) {
- fd = open(argv[args], 0);
+ fd = open(argv[args], O_RDONLY);
if (fd < 0) {
printf("could not open %s: %s\n", argv[args], errno_str());
goto out;