From: Mike Yuan Date: Thu, 5 Mar 2026 15:40:54 +0000 (+0100) Subject: path-util: drop unused paths_check_timestamp() X-Git-Tag: v260-rc3~78 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=df51a04a751eff890befa0430cc5cbc6204e642a;p=thirdparty%2Fsystemd.git path-util: drop unused paths_check_timestamp() --- diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 0394d26420c..8d60365767f 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -17,7 +17,6 @@ #include "stat-util.h" #include "string-util.h" #include "strv.h" -#include "time-util.h" bool is_path(const char *p) { if (!p) /* A NULL pointer is definitely not a path */ @@ -785,42 +784,6 @@ int find_executable_full( return last_error; } -bool paths_check_timestamp(const char* const* paths, usec_t *timestamp, bool update) { - bool changed = false, originally_unset; - - assert(timestamp); - - if (!paths) - return false; - - originally_unset = *timestamp == 0; - - STRV_FOREACH(i, paths) { - struct stat stats; - usec_t u; - - if (stat(*i, &stats) < 0) - continue; - - u = timespec_load(&stats.st_mtim); - - /* check first */ - if (*timestamp >= u) - continue; - - log_debug(originally_unset ? "Loaded timestamp for '%s'." : "Timestamp of '%s' changed.", *i); - - /* update timestamp */ - if (update) { - *timestamp = u; - changed = true; - } else - return true; - } - - return changed; -} - static int executable_is_good(const char *executable) { _cleanup_free_ char *p = NULL, *d = NULL; int r; diff --git a/src/basic/path-util.h b/src/basic/path-util.h index d70fc3b1bc6..e2e80ae91f7 100644 --- a/src/basic/path-util.h +++ b/src/basic/path-util.h @@ -105,8 +105,6 @@ static inline int find_executable(const char *name, char **ret_filename) { return find_executable_full(name, /* root= */ NULL, NULL, true, ret_filename, NULL); } -bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, bool update); - int fsck_exists(void); int fsck_exists_for_fstype(const char *fstype);