From 41fd1f66259fae8b9cac58caf67a4908b78dd1f9 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Sat, 14 Jul 2007 14:44:29 +0200 Subject: add O_RDONLY flag to open() call --- commands/cat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'commands/cat.c') 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 #include #include +#include #include #include #include @@ -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; -- cgit v1.2.3