diff options
author | Charlie Shepherd <masterdriverz@gentoo.org> | 2007-11-10 10:01:28 +0000 |
---|---|---|
committer | Charlie Shepherd <masterdriverz@gentoo.org> | 2007-11-10 10:01:28 +0000 |
commit | ded91bd8208b1d8a1c7b145f3ee5741b6ad57591 (patch) | |
tree | 1036b39ea40e99b8b6c5b149b3a56fe1d0afc5c1 /toys/touch.c | |
parent | d42ed83f2173dd3f4c0571c443b7bae80577eb2b (diff) | |
download | toybox-ded91bd8208b1d8a1c7b145f3ee5741b6ad57591.tar.gz |
Don't error on stat success, and create files with a sensible mode instead of 000
Diffstat (limited to 'toys/touch.c')
-rw-r--r-- | toys/touch.c | 5 |
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) { |