]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
path-util: drop unused paths_check_timestamp()
authorMike Yuan <me@yhndnzj.com>
Thu, 5 Mar 2026 15:40:54 +0000 (16:40 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 5 Mar 2026 17:39:39 +0000 (02:39 +0900)
src/basic/path-util.c
src/basic/path-util.h

index 0394d26420c587010bdcf3188d6e74934e96e04e..8d60365767f41748f8344c8da25e0697ba329f93 100644 (file)
@@ -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;
index d70fc3b1bc6866f3bff07865af7d5abbe8ef7c07..e2e80ae91f7e7ffff342be72819551b1e8aa4de1 100644 (file)
@@ -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);