On Tue, Apr 13, 2021 at 11:08 PM Xabier Oneca -- xOneca <xon...@gmail.com> wrote: > > Hi Denys, > > > Applied, thank you > > You over-shrunk the code and omitted what seems to be a fundamental > part of the logic of the applet. Now 'touch -am file' does not update > times. > > Here's the merged hunk where the bug is: > > - if ((opts & (OPT_a | OPT_m)) && !newtime) { > - time(&timebuf[0].tv_sec); > - timebuf[1].tv_sec = timebuf[0].tv_sec; > - newtime = timebuf; > + if (opts & OPT_a) { > + timebuf[1].tv_nsec = UTIME_OMIT; > + } > + if (opts & OPT_m) { > + timebuf[0].tv_nsec = UTIME_OMIT; > } > > From https://pubs.opengroup.org/onlinepubs/007904975/utilities/touch.html: > > -a Change the access time of file. Do not change the modification > time unless -m is also specified. > -m Change the modification time of file. Do not change the access > time unless -a is also specified.
IOW, -am should be the same as "neither -a nor -m" ? _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox