]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Remove dietlibc stat::st_mtim workaround
authorEmil Velikov <emil.l.velikov@gmail.com>
Sat, 24 May 2025 14:40:49 +0000 (15:40 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 30 May 2025 14:04:02 +0000 (09:04 -0500)
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 <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/359
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
meson.build
shared/util.c

index 4a718275d7cb1711bd18f6a3ac920bbc478ccadb..75d309b170735e755c84125fb33a4a3d1d9f1509 100644 (file)
@@ -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 <sys/stat.h>']]
-  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 = [
index 4541cabbeda6e8c72b05c6b3cdf445f6a6d88cbf..571f4afa5f1041b1bbf06315b70022e285c489fd 100644 (file)
@@ -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)