]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: remove *lstat* wrappers
authorEmil Velikov <emil.l.velikov@gmail.com>
Sat, 14 Sep 2024 13:57:44 +0000 (14:57 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 17 Sep 2024 03:01:34 +0000 (22:01 -0500)
The majority of these were initially introduced with commit 123e827
("testsuite preload: Factorize into macros, add more stat and open
variants").

The commit itself was meant to refactor existing wrappers and add new
_xstat (aka stat) variants. The lstat variants were never used in kmod
directly nor indirectly via header macros.

The rest were added to mimic the original, without much testing it
seems.

They are all dead code - remove them.

In theory one could have a macro/helper that calls `lstat` for `stat`
itself, although that isn't a practical solution for a few reasons.

The functionality across the two varies, where if the path provided is
a symlink `stat` follows it, while `lstat` gets the details for the link
itself. To fix this, the wrapper would need second syscall to resolve
the symlink, which will cause notable performance regression wrt using
using the `stat`/`stat64` syscall alone.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/131
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
testsuite/path.c

index eae7d2688af6216123805b756778eb7d7b8201ec..9a7918c065780f5eae2678d1b0d0216668f1aa54 100644 (file)
@@ -187,29 +187,23 @@ WRAP_2ARGS(FILE*, NULL, fopen, const char*);
 WRAP_2ARGS(int, -1, mkdir, mode_t);
 WRAP_2ARGS(int, -1, access, int);
 WRAP_2ARGS(int, -1, stat, struct stat*);
-WRAP_2ARGS(int, -1, lstat, struct stat*);
 
 WRAP_OPEN();
 
 #if HAVE_DECL___GLIBC__
 WRAP_2ARGS(FILE*, NULL, fopen64, const char*);
 WRAP_2ARGS(int, -1, stat64, struct stat64*);
-WRAP_2ARGS(int, -1, lstat64, struct stat64*);
 
 struct __stat64_t64;
 extern int __stat64_time64 (const char *file, struct __stat64_t64 *buf);
-extern int __lstat64_time64 (const char *file, struct __stat64_t64 *buf);
 WRAP_2ARGS(int, -1, __stat64_time64, struct __stat64_t64*);
-WRAP_2ARGS(int, -1, __lstat64_time64, struct __stat64_t64*);
 
 WRAP_OPEN(64);
 #endif
 
 #ifdef HAVE___XSTAT
 WRAP_VERSTAT(__x,);
-WRAP_VERSTAT(__lx,);
 #if HAVE_DECL___GLIBC__
 WRAP_VERSTAT(__x,64);
-WRAP_VERSTAT(__lx,64);
 #endif
 #endif