path-util: drop unused paths_check_timestamp()

This commit is contained in:
Mike Yuan
2026-03-06 02:39:39 +09:00
committed by Yu Watanabe
parent f8ed94ea99
commit df51a04a75
2 changed files with 0 additions and 39 deletions
-37
View 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;
-2
View 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);