X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Futil.c;h=f5fcebebe7a1c26028593ebd93446e5eefb2d4ad;hb=d01efa07444e49aafd78e0aa822168da688d53f5;hp=11cab6dcf1710f590b2a879f019f274ead1e6020;hpb=40672b99c7da7efd317fc31612504fe7d5ab0b65;p=elogind.git diff --git a/src/shared/util.c b/src/shared/util.c index 11cab6dcf..f5fcebebe 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -60,10 +60,14 @@ #include #include #include -#include #include #include #include + +/* When we include libgen.h because we need dirname() we immediately + * undefine basename() since libgen.h defines it as a macro to the XDG + * version which is really broken. */ +#include #undef basename #ifdef HAVE_SYS_AUXV_H @@ -6452,7 +6456,7 @@ int container_get_leader(const char *machine, pid_t *pid) { assert(machine); assert(pid); - p = strappenda("/run/systemd/machines/", machine); + p = strjoina("/run/systemd/machines/", machine); r = parse_env_file(p, NEWLINE, "LEADER", &s, "CLASS", &class, NULL); if (r == -ENOENT) return -EHOSTDOWN; @@ -6691,7 +6695,7 @@ int open_tmpfile(const char *path, int flags) { #endif /* Fall back to unguessable name + unlinking */ - p = strappenda(path, "/systemd-tmp-XXXXXX"); + p = strjoina(path, "/systemd-tmp-XXXXXX"); fd = mkostemp_safe(p, flags); if (fd < 0) @@ -7220,7 +7224,7 @@ int take_password_lock(const char *root) { * awfully racy, and thus we just won't do them. */ if (root) - path = strappenda(root, "/etc/.pwd.lock"); + path = strjoina(root, "/etc/.pwd.lock"); else path = "/etc/.pwd.lock";