[Bug 15622] mv timestamp awkward behaviour

bugzilla at busybox.net bugzilla at busybox.net
Sat Jun 10 09:57:57 UTC 2023


https://bugs.busybox.net/show_bug.cgi?id=15622

--- Comment #1 from JM Friedt <friedtj at free.fr> ---
This appears to be due to
                times[1].tv_sec = times[0].tv_sec = source_stat.st_mtime; 
                times[1].tv_usec = times[0].tv_usec = 0;
in libbb/copy_file.c in 
int FAST_FUNC copy_file(const char *source, const char *dest, int flags)
which sets the fractional part of the time to 0 irrelevant of the selected
options.

Is this behaviour expected when coreutils/stat.c states
static const char *human_time(struct timespec *ts)
{
        char fmt[sizeof("%Y-%m-%d %H:%M:%S.123456789 %z") + /*paranoia*/ 8];

        /* coreutils 6.3 compat */
#define buf bb_common_bufsiz1
        setup_common_bufsiz();

        sprintf(stpcpy(fmt, "%Y-%m-%d %H:%M:%S"), ".%09u %%z",
(unsigned)ts->tv_nsec);
        strftime(buf, COMMON_BUFSIZE, fmt, localtime(&ts->tv_sec));
        return buf;
#undef buf
}
able to cope with sub-second resolution?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list