summaryrefslogtreecommitdiff
path: root/src/libudev
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-15 14:20:32 +0200
committerTom Gundersen <teg@jklm.no>2014-09-16 12:12:56 +0200
commit37d522746b67fda0d52111364d81358ce560bcf7 (patch)
treeb9666d700055dfb449527b622555eda1debd0484 /src/libudev
parent23bf8dd7d5ce1e2a52f28d5d242109ddb668b3fb (diff)
libudev: util - drop util_delete_path()
Use rmdir_parents() from src/shared instead.
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/libudev-private.h1
-rw-r--r--src/libudev/libudev-util.c32
2 files changed, 0 insertions, 33 deletions
diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h
index 1c060d95a3..2f74bc0883 100644
--- a/src/libudev/libudev-private.h
+++ b/src/libudev/libudev-private.h
@@ -167,7 +167,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/libudev/libudev-util.c b/src/libudev/libudev-util.c
index 3bc9c67f3b..a7125fa63f 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -45,38 +45,6 @@
* Utilities useful when dealing with devices and device node names.
*/
-int util_delete_path(struct udev *udev, const char *path)
-{
- char p[UTIL_PATH_SIZE];
- char *pos;
- int err = 0;
-
- if (path[0] == '/')
- while(path[1] == '/')
- path++;
- strscpy(p, sizeof(p), path);
- pos = strrchr(p, '/');
- if (pos == p || pos == NULL)
- return 0;
-
- for (;;) {
- *pos = '\0';
- pos = strrchr(p, '/');
-
- /* don't remove the last one */
- if ((pos == p) || (pos == NULL))
- break;
-
- err = rmdir(p);
- if (err < 0) {
- if (errno == ENOENT)
- err = 0;
- break;
- }
- }
- return err;
-}
-
/* handle "[<SUBSYSTEM>/<KERNEL>]<attribute>" format */
int util_resolve_subsys_kernel(struct udev *udev, const char *string,
char *result, size_t maxsize, int read_value)