aboutsummaryrefslogtreecommitdiff
path: root/coreutils/touch.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/touch.c')
-rw-r--r--coreutils/touch.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 4c7362acd..a7907e2c8 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -156,12 +156,10 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
156 /* If both -a and -m specified, both times should be set. 156 /* If both -a and -m specified, both times should be set.
157 * IOW: set OMIT only if one, not both, of them is given! 157 * IOW: set OMIT only if one, not both, of them is given!
158 */ 158 */
159 if ((opts & (OPT_a|OPT_m)) != (OPT_a|OPT_m)) { 159 if ((opts & (OPT_a|OPT_m)) == OPT_a)
160 if (opts & OPT_a) 160 timebuf[1].tv_nsec = UTIME_OMIT;
161 timebuf[1].tv_nsec = UTIME_OMIT; 161 if ((opts & (OPT_a|OPT_m)) == OPT_m)
162 if (opts & OPT_m) 162 timebuf[0].tv_nsec = UTIME_OMIT;
163 timebuf[0].tv_nsec = UTIME_OMIT;
164 }
165 163
166 argv += optind; 164 argv += optind;
167 do { 165 do {