diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-14 14:44:29 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-14 14:44:29 +0200 |
commit | 41fd1f66259fae8b9cac58caf67a4908b78dd1f9 (patch) | |
tree | 0193f3fb83edaaaff509e9bee21b0c95dc0cc79c /commands | |
parent | 828fe2d8e442741ad30a1cdc85b4ddf7b5125b5c (diff) | |
download | barebox-41fd1f66259fae8b9cac58caf67a4908b78dd1f9.tar.gz barebox-41fd1f66259fae8b9cac58caf67a4908b78dd1f9.tar.xz |
add O_RDONLY flag to open() call
Diffstat (limited to 'commands')
-rw-r--r-- | commands/cat.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/commands/cat.c b/commands/cat.c index b1b06e8355..dd477c54f9 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; |