changeset 161:b4c79ab09f9e

Don't error on stat success, and create files with a sensible mode instead of 000
author Charlie Shepherd <masterdriverz@gentoo.org>
date Sat, 10 Nov 2007 10:01:28 +0000
parents 2eb41e7bf180
children 0864aec90026
files toys/touch.c
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/toys/touch.c	Sat Nov 10 09:30:02 2007 +0000
+++ b/toys/touch.c	Sat Nov 10 10:01:28 2007 +0000
@@ -62,14 +62,11 @@
 
 		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) {