mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 16:31:24 +00:00
Continue processing files if we are asked to touch, but not create, a file
which doesn't exist.
This commit is contained in:
parent
1a781a499f
commit
dba11452cb
@ -56,9 +56,11 @@ extern int touch_main(int argc, char **argv)
|
|||||||
fd = open(*argv, (create == FALSE) ? O_RDWR : O_RDWR | O_CREAT,
|
fd = open(*argv, (create == FALSE) ? O_RDWR : O_RDWR | O_CREAT,
|
||||||
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
|
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
if (create == FALSE && errno == ENOENT)
|
if (create == FALSE && errno == ENOENT) {
|
||||||
return EXIT_SUCCESS;
|
argc--;
|
||||||
else {
|
argv++;
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
perror_msg_and_die("%s", *argv);
|
perror_msg_and_die("%s", *argv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user