From 1322beb384ea43a15c17f8229e7db070949dd331 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 7 Jan 2007 22:51:12 -0500 Subject: xopen() wants 2 arguments unless you're creating a file, in which case you need 3. Doing varargs for this doesn't really appeal to me (bugs in waiting) so I made an xcreate() that takes 3 args, and had xopen() call it with 0 for the third argument. That way, if we feed O_CREAT to xopen() the permission 000 result should be easy to spot. --- toys/catv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys') diff --git a/toys/catv.c b/toys/catv.c index 3a36de6b..e37f307b 100644 --- a/toys/catv.c +++ b/toys/catv.c @@ -23,7 +23,7 @@ int catv_main(void) // Read from stdin if there's nothing else to do. fd = 0; - if (*argv && 0>(fd = xopen(*argv, O_RDONLY, 0))) retval = EXIT_FAILURE; + if (*argv && 0>(fd = xopen(*argv, O_RDONLY))) retval = EXIT_FAILURE; else for(;;) { int i, res; -- cgit v1.2.3