summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-17 20:10:42 -0400
committerAnthony G. Basile <blueness@gentoo.org>2014-09-17 20:10:42 -0400
commit39f24db770b55348f3056871429d0af6ed2405ec (patch)
tree60ac9cca83637842fbf094418b1426dcc41d9226
parent5216331b7d3b14362c2ddc4af6520011120475e4 (diff)
libudev: util - drop util_delete_path()
Use rmdir_parents() from src/shared instead. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--src/libudev/libudev-private.h1
-rw-r--r--src/udev/udev-node.c3
-rw-r--r--test/test-udev.c2
3 files changed, 2 insertions, 4 deletions
diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h
index 69319dbffc..9ec2931d5b 100644
--- a/src/libudev/libudev-private.h
+++ b/src/libudev/libudev-private.h
@@ -168,7 +168,6 @@ unsigned int util_string_hash32(const char *key);
uint64_t util_string_bloom64(const char *str);
/* libudev-util-private.c */
-int util_delete_path(struct udev *udev, const char *path);
int util_resolve_subsys_kernel(struct udev *udev, const char *string, char *result, size_t maxsize, int read_value);
#endif
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index 14dd88dd43..c54228a609 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -179,7 +179,6 @@ static const char *link_find_prioritized(struct udev_device *dev, bool add, cons
/* manage "stack of names" with possibly specified device priorities */
static void link_update(struct udev_device *dev, const char *slink, bool add) {
- struct udev *udev = udev_device_get_udev(dev);
char name_enc[UTIL_PATH_SIZE];
char filename[UTIL_PATH_SIZE * 2];
char dirname[UTIL_PATH_SIZE];
@@ -197,7 +196,7 @@ static void link_update(struct udev_device *dev, const char *slink, bool add) {
if (target == NULL) {
log_debug("no reference left, remove '%s'", slink);
if (unlink(slink) == 0)
- util_delete_path(udev, slink);
+ rmdir_parents(slink, "/");
} else {
log_debug("creating link '%s' to '%s'", slink, target);
node_symlink(dev, target, slink);
diff --git a/test/test-udev.c b/test/test-udev.c
index 0d04078542..446849e4b0 100644
--- a/test/test-udev.c
+++ b/test/test-udev.c
@@ -160,7 +160,7 @@ int main(int argc, char *argv[]) {
mknod(udev_device_get_devnode(dev), mode, udev_device_get_devnum(dev));
} else {
unlink(udev_device_get_devnode(dev));
- util_delete_path(udev, udev_device_get_devnode(dev));
+ rmdir_parents(udev_device_get_devnode(dev), "/");
}
}