struct stat in libc for Linux kernel contains few fields more since 14+
years [1]. From bits/stat.h:
```
struct timespec st_atim; /* Time of last access. */
struct timespec st_mtim; /* Time of last modification. */
struct timespec st_ctim; /* Time of last status change. */
# define st_atime st_atim.tv_sec /* Backward compatibility. */
# define st_mtime st_mtim.tv_sec
# define st_ctime st_ctim.tv_sec
```
The conventional fields became an alias.
POSIX.1-2008 made struct stat st_[acm]tim mandatory [2].
OS takes care to initialize struct stat properly [3]. By not using an OS
syscall or a libc wrapper to fill struct stat, we have to take care of
initializing all fields (or at least those being used later) explicitly.
[1]: https://www.sourceware.org/ml/libc-alpha/2002-12/msg00011.html
[2]: https://www.sourceware.org/ml/libc-alpha/2009-11/msg00102.html
[3]: https://www.sourceware.org/ml/libc-alpha/2002-12/msg00013.html
Fixes: file timestamps not preserved (https://mail.gnome.org/archives/mc-devel/2017-April/msg00000.html)
Reported-By: Nerijus Baliunas <nerijus@users.sourceforge.net>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This is a preliminary step before being able to write tests for our rpm helper.
We introduce 'rpm2tags', a tool for converting RPM packages to parsable text
files. This will enable us to write tests that can run even where the 'rpm'
program isn't installed.
Signed-off-by: Mooffie <mooffie@gmail.com>
We introduce a mechanism by which tests can easily access configure-time
parameters (like @PERL@, @AWK@, ...).
It works by "sourcing" a file named config.sh (residing in the build tree):
. "$MC_TEST_EXTFS_CONFIG_SH"
$PERL -e 'print "hello"'
(Although config.sh has a shell syntax, Perl and Python programs too can
benefit from it, because it can be sourced into an .env_vars file and the
values exported from there.)
Of course, one can also use the traditional method, of *.in files listed in
configure.ac, but the mechanism introduced here is a more comfortable approach.
Signed-off-by: Mooffie <mooffie@gmail.com>
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 introduce 'mc_parse_ls_l', a tool for parsing file-listings in format
similar to that of 'ls -l'. This format is used by the various extfs helpers.
We'll use this tool, in the next commit, to build a tester.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
m4.include/stat-size.m4, lib/stat-size.h: get these files from Gnulib.
src/filemanager/ioblksize.h: get this file from Coreutils.
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.)
Macros get from other projects keep their original names:
gl_FSTYPENAME, AX_PATH_LIB_PCRE, etc.
Macros initially writtem for MC have original names with prefix mc_:
mc_VERSION, mc_CHECK_GLIB, etc
Macros get from other projects and modified for MC keep their
original names with prefix mc_:
mc_cu_PREREQ_STAT_PROG, mc_AC_GET_FS_INFO.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Instead of checking for sys/mkdev.h headerfile, there is the
AC_HEADER_MAJOR helper for how to get major(), minor(), makedev().
Sinc with GLib efb1701bf3baf6f5b05fd1a7a5a4ff990a7dc460.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
As we use 'AC_CONFIG_SUBDIRS' macro for samba sources option checking is
disabled for us.
Before the patch:
$ ./configure --with-i-have-misspelled-editor-for-edit
...
# no warnings
The patch enables warnings back only for top-level ./configure:
$ ./configure --with-i-have-misspelled-editor-for-edit
...
configure: WARNING: unrecognized options: --with-i-have-misspelled-editor-for-edit
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Remove tests whose results are not used:
* AC_CHECK_HEADERS of unistd.h, fcntl.h, sys/time.h, sys/types.h
* AC_HEADER_MAJOR
* AC_HEADER_TIME
* AC_HEADER_DIRENT
* AC_CHECK_FUNCS of isascii, statfs, sysconf, tcgetattr, tcsetattr, ftruncate
* AC_FUNC_STRCOLL
AC_C_CONST is obsolete, today it is safe to assume all C compilers
support at least C89.
The INTERACTIVE UNIX that needed AC_ISC_POSIX is long dead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
For upload English hint-file to transifex, type:
cd doc/hints/po && make to-transifex
For download translation from Transifex type:
cd doc/hints/po && make from-transifex && \
git add ../l10n/mc.hints.* && \
git commit -s -m 'Update hints files from Transifex'
WARNING! For the functionality you should have installed 'tx' and 'po4a'
utilities. These utilities isn't required for compile and install mc
(you may install these utilities only if you want to interact with Transifex).
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Fix of exec_prefix expansion and usage.
Some distros use autoconf site scripts resourced via $CONFIG_SITE
environment varaible. That scripts are defined variable libexecdir
as
libexecdir='${exec_prefix}/lib'
In this case, EXTHELPERSDIR variable is generated wrongly, because
the 'exec_prefix' variable isn't expanded.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Due to date formatting, uc1541 extfs plugin is unusable, even tough the date formatting,
which is the one cause of the problem is coherent with the attached documentation (MM-DD-YYYY hh:mm).
Another problem with uc1541 script is connected rather with legal characters used in filename
rather than with script itself - in PET ASCII it is perfectly fine to use slash "/" character
in filenames, and as a side effect all files containing slash inside d64 image are represented
as directories on MC.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
If --prefix is not set in command line, EXTHELPERSDIR was expanded to
NONE/libexec/mc/ext.d in misc/mc.ext and misc/ext.d/Makefile.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
src/filemanager/filegui.c does not compile on Solaris due to missing macros.
AVE_STRUCT_STATVFS_F_BASETYPE and HAVE_STRUCT_STATVFS_F_FSTYPENAME macros
are not set or even defined in config.h. configure scrips does not even
check for those members.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>