MC truncates timestamps during file copy and drops sub-second precision.
Make use of utimensat(), introduced in Linux kernel 2.6.22 (and since
2.6.26 compatible with POSIX-1.2008).
Signed-off-by: Andrey Gursky <andrey.gursky@e-mail.ua>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
We also improve the documentation of vfs_parse_filedate(), which does the
actual work.
Note that in the user-facing documentation (extfs/helpers/README) there are
two things we prefer *not* to mention about vfs_parse_filedate's ability:
* Accepting the format "MM-DD-YY hh:mm[:ss]", as this two-digit year is
more likely to confuse readers of such dates.
* Accepting '/', instead of '-', as the separator in MM-DD-YYYY. (Considering
that some scripts do use '/', maybe we should mention it?)
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
utilvfs.c: In function 'vfs_die':
utilvfs.c:354:1: warning: function might be candidate for attribute 'noreturn' [-Wsuggest-attribute=noreturn]
vfs_die (const char *m)
^~~~~~~
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Cleanup following cppcheck warnings:
[lib/vfs/direntry.c:121]: (style) Clarify calculation precedence for '&' and '?'.
[lib/vfs/direntry.c:386]: (style) Clarify calculation precedence for '&' and '?'.
[lib/vfs/direntry.c:391]: (style) Clarify calculation precedence for '&' and '?'.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
On systems where 'mode_t' is smaller than 'int', doing 'va_arg (ap, mode_t)' is
wrong because of C's "default argument promotions". GCC 4 creates crashing code
in this case.
The "va_arg" page of Gnulib's manual describes the problem and a simple solution:
https://www.gnu.org/software/gnulib/manual/html_node/va_005farg.html
However, since that solution reportedly (see thread at next link) still causes
GCC to print warnings (for no good reason; perhaps this was fixed in newer
GCCs), we pick a solution that defines a PROMOTED_MODE_T at the configuration
stage:
https://lists.gnu.org/archive/html/bug-gnulib/2009-05/msg00231.html
(We take our 'mode_t.m4' from the most recent Gnulib source.)
(If any of the URLs above no longer works, simply search the web for the
mentioned words.)
Use real errno or set it to 0 when no meaningful error code exists
for current user error message.
Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Introduce -Wswitch-default check.
Some minor cosmetics.
Thanks Andreas Mohr <and at gmx dot li> for original patch.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>