diff --git a/src/storage.c b/src/storage.c index e636bfae..8f8a6d71 100644 --- a/src/storage.c +++ b/src/storage.c @@ -286,32 +286,6 @@ int storage_network_touch(enum security type, const char *ssid) return -errno; } -int storage_network_get_mtime(enum security type, const char *ssid, - struct timespec *mtim) -{ - char *path; - int ret; - struct stat sb; - - if (ssid == NULL) - return -EINVAL; - - path = storage_get_network_file_path(type, ssid); - ret = stat(path, &sb); - l_free(path); - - if (ret < 0) - return -errno; - - if (!S_ISREG(sb.st_mode)) - return -EINVAL; - - if (mtim) - memcpy(mtim, &sb.st_mtim, sizeof(struct timespec)); - - return 0; -} - void storage_network_sync(enum security type, const char *ssid, struct l_settings *settings) { diff --git a/src/storage.h b/src/storage.h index 8df5fbeb..6cb282ee 100644 --- a/src/storage.h +++ b/src/storage.h @@ -39,8 +39,6 @@ char *storage_get_network_file_path(enum security type, const char *ssid); struct l_settings *storage_network_open(enum security type, const char *ssid); int storage_network_touch(enum security type, const char *ssid); -int storage_network_get_mtime(enum security type, const char *ssid, - struct timespec *mtim); void storage_network_sync(enum security type, const char *ssid, struct l_settings *settings); int storage_network_remove(enum security type, const char *ssid); diff --git a/src/util.c b/src/util.c index 7bebb446..f787ce6b 100644 --- a/src/util.c +++ b/src/util.c @@ -209,22 +209,3 @@ const char *util_get_username(const char *identity) return identity; } - -int util_timespec_compare(const struct timespec *tsa, - const struct timespec *tsb) -{ - - if (tsa->tv_sec > tsb->tv_sec) - return -1; - - if (tsa->tv_sec < tsb->tv_sec) - return 1; - - if (tsa->tv_nsec > tsb->tv_nsec) - return -1; - - if (tsa->tv_nsec < tsb->tv_nsec) - return -1; - - return 0; -} diff --git a/src/util.h b/src/util.h index 4492cafb..55075b67 100644 --- a/src/util.h +++ b/src/util.h @@ -65,7 +65,4 @@ static inline bool util_mem_is_zero(const uint8_t *field, size_t size) return true; } -int util_timespec_compare(const struct timespec *tsa, - const struct timespec *tsb); - #endif /* __UTIL_H */