diff options
Diffstat (limited to 'src/libudev')
-rw-r--r-- | src/libudev/libudev-list.c | 3 | ||||
-rw-r--r-- | src/libudev/libudev-private.h | 2 | ||||
-rw-r--r-- | src/libudev/libudev-util.c | 46 |
3 files changed, 1 insertions, 50 deletions
diff --git a/src/libudev/libudev-list.c b/src/libudev/libudev-list.c index 044ee3a0cb..19e9130be0 100644 --- a/src/libudev/libudev-list.c +++ b/src/libudev/libudev-list.c @@ -246,8 +246,7 @@ void udev_list_cleanup(struct udev_list *list) struct udev_list_entry *entry_loop; struct udev_list_entry *entry_tmp; - free(list->entries); - list->entries = NULL; + list->entries = mfree(list->entries); list->entries_cur = 0; list->entries_max = 0; udev_list_entry_foreach_safe(entry_loop, entry_tmp, udev_list_get_entry(list)) diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h index 1240ea79cc..c1785bf4c2 100644 --- a/src/libudev/libudev-private.h +++ b/src/libudev/libudev-private.h @@ -135,8 +135,6 @@ int udev_queue_export_device_finished(struct udev_queue_export *udev_queue_expor #define UTIL_NAME_SIZE 512 #define UTIL_LINE_SIZE 16384 #define UDEV_ALLOWED_CHARS_INPUT "/ $%?," -ssize_t util_get_sys_core_link_value(struct udev *udev, const char *slink, const char *syspath, char *value, size_t size); -int util_resolve_sys_link(struct udev *udev, char *syspath, size_t size); int util_log_priority(const char *priority); size_t util_path_encode(const char *src, char *dest, size_t size); void util_remove_trailing_chars(char *path, char c); diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c index f4656277c6..4408bb59f6 100644 --- a/src/libudev/libudev-util.c +++ b/src/libudev/libudev-util.c @@ -100,52 +100,6 @@ int util_resolve_subsys_kernel(struct udev *udev, const char *string, return 0; } -ssize_t util_get_sys_core_link_value(struct udev *udev, const char *slink, const char *syspath, char *value, size_t size) -{ - char path[UTIL_PATH_SIZE]; - char target[UTIL_PATH_SIZE]; - ssize_t len; - const char *pos; - - strscpyl(path, sizeof(path), syspath, "/", slink, NULL); - len = readlink(path, target, sizeof(target)); - if (len <= 0 || len == (ssize_t)sizeof(target)) - return -1; - target[len] = '\0'; - pos = strrchr(target, '/'); - if (pos == NULL) - return -1; - pos = &pos[1]; - return strscpy(value, size, pos); -} - -int util_resolve_sys_link(struct udev *udev, char *syspath, size_t size) -{ - char link_target[UTIL_PATH_SIZE]; - - ssize_t len; - int i; - int back; - char *base = NULL; - - len = readlink(syspath, link_target, sizeof(link_target)); - if (len <= 0 || len == (ssize_t)sizeof(link_target)) - return -1; - link_target[len] = '\0'; - - for (back = 0; startswith(&link_target[back * 3], "../"); back++) - ; - for (i = 0; i <= back; i++) { - base = strrchr(syspath, '/'); - if (base == NULL) - return -EINVAL; - base[0] = '\0'; - } - - strscpyl(base, size - (base - syspath), "/", &link_target[back * 3], NULL); - return 0; -} - int util_log_priority(const char *priority) { char *endptr; |