From: Yu Watanabe Date: Thu, 20 May 2021 05:24:57 +0000 (+0900) Subject: sd-bus: use strextend() X-Git-Tag: v249-rc1~182^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03c324c578a71ad3c97fb3a230fffc7e7c066299;p=thirdparty%2Fsystemd.git sd-bus: use strextend() --- diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index 0ec0d8d26ea..090288af0df 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -1574,18 +1574,12 @@ int bus_set_address_machine(sd_bus *b, bool user, const char *machine) { return -ENOMEM; if (user) { - char *k; - /* Ideally we'd use the "--user" switch to systemd-stdio-bridge here, but it's only * available in recent systemd versions. Using the "-p" switch with the explicit path * is a working alternative, and is compatible with older versions, hence that's what * we use here. */ - - k = strjoin(a, ",argv7=-punix:path%3d%24%7bXDG_RUNTIME_DIR%7d/bus"); - if (!k) + if (!strextend(&a, ",argv7=-punix:path%3d%24%7bXDG_RUNTIME_DIR%7d/bus")) return -ENOMEM; - - free_and_replace(a, k); } } else { _cleanup_free_ char *e = NULL;