22 lines
828 B
Diff
22 lines
828 B
Diff
|
diff -urpN busybox-1.16.0/coreutils/touch.c busybox-1.16.0-touch/coreutils/touch.c
|
||
|
--- busybox-1.16.0/coreutils/touch.c 2010-01-25 01:59:38.000000000 +0100
|
||
|
+++ busybox-1.16.0-touch/coreutils/touch.c 2010-03-21 13:05:34.000000000 +0100
|
||
|
@@ -104,7 +104,7 @@ int touch_main(int argc UNUSED_PARAM, ch
|
||
|
}
|
||
|
|
||
|
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, ch
|
||
|
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;
|
||
|
}
|