From: Emil Velikov Date: Sat, 24 May 2025 14:40:49 +0000 (+0100) Subject: Remove dietlibc stat::st_mtim workaround X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2077cb39f2beffb15b41e73095f00a17684eca12;p=thirdparty%2Fkmod.git Remove dietlibc stat::st_mtim workaround Some versions of dietlibc lack struct stat::st_mtim, which was introduced with POSIX.1-2008. Considering the slow development cycle of dietlibc (last three releases are 2024, 2018 and 2013) and there's no popular user (nor one in CI) of it, let's remove the workaround. All the other runtimes that we target - glibc, bionic and musl - have the struct member. Iff needed we can reintroduce the workaround at a later stage alongside a CI permutation. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/359 Signed-off-by: Lucas De Marchi --- diff --git a/meson.build b/meson.build index 4a718275..75d309b1 100644 --- a/meson.build +++ b/meson.build @@ -65,18 +65,6 @@ foreach tuple : _builtins cdata.set10('HAVE_@0@'.format(builtin.to_upper()), have) endforeach -# dietlibc doesn't have st.st_mtim struct member -# XXX: we use both st_mtim and st_mtime ... unify and test -foreach tuple : [['struct stat', 'st_mtim', '#include ']] - struct = tuple[0] - member = tuple[1] - prefix = tuple[2] - if cc.has_member(struct, member, prefix : prefix, args : '-D_GNU_SOURCE') - cdata.set('HAVE_@0@_@1@'.format(struct.underscorify().to_upper(), - member.to_upper()), true) - endif -endforeach - # basename may be only available in libgen.h with the POSIX behavior, # not desired here _decls = [ diff --git a/shared/util.c b/shared/util.c index 4541cabb..571f4afa 100644 --- a/shared/util.c +++ b/shared/util.c @@ -576,11 +576,7 @@ unsigned long long now_msec(void) unsigned long long stat_mstamp(const struct stat *st) { -#ifdef HAVE_STRUCT_STAT_ST_MTIM return ts_usec(&st->st_mtim); -#else - return (unsigned long long)st->st_mtime; -#endif } static int dlsym_manyv(void *dl, va_list ap)