From 9c210f0efb1959895df237a96210a73253b5b9ed Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 13 Apr 2021 15:49:06 +0200 Subject: [PATCH] touch: fix previous commit function old new delta touch_main 423 414 -9 Signed-off-by: Denys Vlasenko --- coreutils/touch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreutils/touch.c b/coreutils/touch.c index 355455363..6c0201374 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c @@ -173,7 +173,7 @@ int touch_main(int argc UNUSED_PARAM, char **argv) /* Try to create the file */ fd = open(*argv, O_RDWR | O_CREAT, 0666); if (fd >= 0) { - if (reference_file || date_str) + if (opts & (OPT_r|OPT_d|OPT_t)) futimens(fd, timebuf); xclose(fd); continue;