← Commit list

dba11452c

Matt Kraai
Matt Kraai
2001-12-07
FAILED Duration: 390s

Subject

Continue processing files if we are asked to touch, but not create, a file which doesn't exist.

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/touch.c+5 -3
@@ -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);
}
}