aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorCharlie Shepherd <masterdriverz@gentoo.org>2007-11-10 10:01:28 +0000
committerCharlie Shepherd <masterdriverz@gentoo.org>2007-11-10 10:01:28 +0000
commitded91bd8208b1d8a1c7b145f3ee5741b6ad57591 (patch)
tree1036b39ea40e99b8b6c5b149b3a56fe1d0afc5c1 /toys
parentd42ed83f2173dd3f4c0571c443b7bae80577eb2b (diff)
downloadtoybox-ded91bd8208b1d8a1c7b145f3ee5741b6ad57591.tar.gz
Don't error on stat success, and create files with a sensible mode instead of 000
Diffstat (limited to 'toys')
-rw-r--r--toys/touch.c5
1 files changed, 1 insertions, 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) {