diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-08-22 12:39:46 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-08-23 15:10:15 +0200 |
commit | e08c10a42476357239b437689b01d984a16084d3 (patch) | |
tree | 30d025d244f3e5b7c2f080fac2b51bda636507af | |
parent | 45519d13a4f2a3c3585e672595762ca621abe65e (diff) | |
download | systemd-e08c10a42476357239b437689b01d984a16084d3.tar.gz |
path-util: drop the now unused dirname_malloc()
-rw-r--r-- | src/basic/path-util.c | 27 | ||||
-rw-r--r-- | src/basic/path-util.h | 1 |
2 files changed, 0 insertions, 28 deletions
diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 88657d5775..c5f30b5be4 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -7,12 +7,6 @@ #include <stdlib.h> #include <unistd.h> -/* When we include libgen.h because we need dirname() we immediately - * undefine basename() since libgen.h defines it as a macro to the - * POSIX version which is really broken. We prefer GNU basename(). */ -#include <libgen.h> -#undef basename - #include "alloc-util.h" #include "chase-symlinks.h" #include "extract-word.h" @@ -774,27 +768,6 @@ int fsck_exists(const char *fstype) { return executable_is_good(checker); } -char* dirname_malloc(const char *path) { - char *d, *dir, *dir2; - - assert(path); - - d = strdup(path); - if (!d) - return NULL; - - dir = dirname(d); - assert(dir); - - if (dir == d) - return d; - - dir2 = strdup(dir); - free(d); - - return dir2; -} - static const char *skip_slash_or_dot(const char *p) { for (; !isempty(p); p++) { if (*p == '/') diff --git a/src/basic/path-util.h b/src/basic/path-util.h index 757ed722d5..41bbc7bb86 100644 --- a/src/basic/path-util.h +++ b/src/basic/path-util.h @@ -151,7 +151,6 @@ int fsck_exists(const char *fstype); _ret; \ }) -char* dirname_malloc(const char *path); int path_find_first_component(const char **p, bool accept_dot_dot, const char **ret); int path_find_last_component(const char *path, bool accept_dot_dot, const char **next, const char **ret); const char *last_path_component(const char *path); |