← Commit list

927e4bb64

Mikhail Gusarov
Mikhail Gusarov
2010-03-21
FAILED Duration: 30s

Subject

touch: do not ignore argument of -d/-t option

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+2 -2
@@ -104,7 +104,7 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
}
do {
- if (utimes(*argv, reference_file ? timebuf : NULL) != 0) {
+ if (utimes(*argv, (reference_file || date_str) ? timebuf : NULL) != 0) {
if (errno == ENOENT) { /* no such file */
if (opts) { /* creation is disabled, so ignore */
continue;
@@ -113,7 +113,7 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
fd = open(*argv, O_RDWR | O_CREAT, 0666);
if (fd >= 0) {
xclose(fd);
- if (reference_file)
+ if (reference_file || date_str)
utimes(*argv, timebuf);
continue;
}