From: Emil Velikov Date: Sat, 18 Jul 2026 14:25:32 +0000 (+0100) Subject: testsuite: convert a should-be-unreachable LOG to an ERR X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e24317c565c64b372c0571bee8a0e2ff24c251b;p=thirdparty%2Fkmod.git testsuite: convert a should-be-unreachable LOG to an ERR Of the two call-sites to remove_directory() we have: - we explicitly stat/S_ISDIR check prior, and - the folder must exist, or out init_module.c implementation is broken Thus is seems very unlikely to trigger the LOG and in practice, it indicates a bug/race condition. Convert it to an ERR and return -1 to indicate that. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/450 Signed-off-by: Lucas De Marchi --- diff --git a/testsuite/delete_module.c b/testsuite/delete_module.c index 46fffb9..0ed172e 100644 --- a/testsuite/delete_module.c +++ b/testsuite/delete_module.c @@ -130,8 +130,8 @@ static int remove_directory(const char *path) char full_path[PATH_MAX]; if (stat(path, &st) != 0 || !S_ISDIR(st.st_mode)) { - LOG("Directory %s not found, skip remove.\n", path); - return 0; + ERR("Directory %s not found, skip remove.\n", path); + return -1; } dir = opendir(path);