summaryrefslogtreecommitdiff
path: root/coreutils/touch.c
diff options
context:
space:
mode:
authorMatt Kraai2001-12-07 21:27:38 +0000
committerMatt Kraai2001-12-07 21:27:38 +0000
commitdba11452cb9f7262542b7eece4293ad0ae8c608e (patch)
tree6ee93814d63dd27463b33af9c8a2c1cde38abce3 /coreutils/touch.c
parent1a781a499ff4da64fa2562a371011f0df4291c58 (diff)
downloadbusybox-dba11452cb9f7262542b7eece4293ad0ae8c608e.zip
busybox-dba11452cb9f7262542b7eece4293ad0ae8c608e.tar.gz
Continue processing files if we are asked to touch, but not create, a file
which doesn't exist.
Diffstat (limited to 'coreutils/touch.c')
-rw-r--r--coreutils/touch.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 2673495..3e2e600 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -56,9 +56,11 @@ extern int touch_main(int argc, char **argv)
fd = open(*argv, (create == FALSE) ? O_RDWR : O_RDWR | O_CREAT,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
if (fd < 0) {
- if (create == FALSE && errno == ENOENT)
- return EXIT_SUCCESS;
- else {
+ if (create == FALSE && errno == ENOENT) {
+ argc--;
+ argv++;
+ continue;
+ } else {
perror_msg_and_die("%s", *argv);
}
}