From ded91bd8208b1d8a1c7b145f3ee5741b6ad57591 Mon Sep 17 00:00:00 2001 From: Charlie Shepherd Date: Sat, 10 Nov 2007 10:01:28 +0000 Subject: Don't error on stat success, and create files with a sensible mode instead of 000 --- toys/touch.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/toys/touch.c b/toys/touch.c index 0b5b2276..b4e3d971 100644 --- a/toys/touch.c +++ b/toys/touch.c @@ -62,14 +62,11 @@ err: if (stat(arg, &sb) == -1) { if (create && errno == ENOENT) { - if (creat(arg, O_RDWR)) + if (creat(arg, 0644)) goto error; if (stat(arg, &sb)) goto error; } - } else { -error: - perror_exit(arg); } if ((set_a+set_m) == 1) { -- cgit v1.2.3