summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-02-03 02:05:59 +0100
committerLennart Poettering <lennart@poettering.net>2015-02-03 02:05:59 +0100
commit63c372cb9df3bee01e3bf8cd7f96f336bddda846 (patch)
treebf4d1b6e41f72927a2b58e7dd21daa0c496aaa96 /src/libsystemd
parent44de0efc6e406515fc1cf8b95d9655d0d7f7ffff (diff)
util: rework strappenda(), and rename it strjoina()
After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-bus/bus-control.c2
-rw-r--r--src/libsystemd/sd-bus/bus-dump.c2
-rw-r--r--src/libsystemd/sd-bus/busctl.c4
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c2
-rw-r--r--src/libsystemd/sd-login/sd-login.c4
5 files changed, 7 insertions, 7 deletions
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
index 8d12c258f7..ac27df8691 100644
--- a/src/libsystemd/sd-bus/bus-control.c
+++ b/src/libsystemd/sd-bus/bus-control.c
@@ -1359,7 +1359,7 @@ int bus_add_match_internal_kernel(
#define internal_match(bus, m) \
((bus)->hello_flags & KDBUS_HELLO_MONITOR \
- ? (isempty(m) ? "eavesdrop='true'" : strappenda((m), ",eavesdrop='true'")) \
+ ? (isempty(m) ? "eavesdrop='true'" : strjoina((m), ",eavesdrop='true'")) \
: (m))
static int bus_add_match_internal_dbus1(
diff --git a/src/libsystemd/sd-bus/bus-dump.c b/src/libsystemd/sd-bus/bus-dump.c
index e27d8027de..7181639645 100644
--- a/src/libsystemd/sd-bus/bus-dump.c
+++ b/src/libsystemd/sd-bus/bus-dump.c
@@ -354,7 +354,7 @@ int bus_creds_dump(sd_bus_creds *c, FILE *f, bool terse) {
color = ansi_highlight();
off = ansi_highlight_off();
- suffix = strappenda(off, "\n");
+ suffix = strjoina(off, "\n");
}
if (c->mask & SD_BUS_CREDS_PID)
diff --git a/src/libsystemd/sd-bus/busctl.c b/src/libsystemd/sd-bus/busctl.c
index f0bc2a76a5..d3c1772019 100644
--- a/src/libsystemd/sd-bus/busctl.c
+++ b/src/libsystemd/sd-bus/busctl.c
@@ -256,8 +256,8 @@ static void print_subtree(const char *prefix, const char *path, char **l) {
l++;
}
- vertical = strappenda(prefix, draw_special_char(DRAW_TREE_VERTICAL));
- space = strappenda(prefix, draw_special_char(DRAW_TREE_SPACE));
+ vertical = strjoina(prefix, draw_special_char(DRAW_TREE_VERTICAL));
+ space = strjoina(prefix, draw_special_char(DRAW_TREE_SPACE));
for (;;) {
bool has_more = false;
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 125b302c95..1bf77e46fb 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -1286,7 +1286,7 @@ int bus_set_address_system_remote(sd_bus *b, const char *host) {
if (!e)
return -ENOMEM;
- c = strappenda(",argv4=--machine=", m);
+ c = strjoina(",argv4=--machine=", m);
}
}
diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c
index c72d23ed53..c171405a65 100644
--- a/src/libsystemd/sd-login/sd-login.c
+++ b/src/libsystemd/sd-login/sd-login.c
@@ -791,7 +791,7 @@ _public_ int sd_machine_get_class(const char *machine, char **class) {
assert_return(machine_name_is_valid(machine), -EINVAL);
assert_return(class, -EINVAL);
- p = strappenda("/run/systemd/machines/", machine);
+ p = strjoina("/run/systemd/machines/", machine);
r = parse_env_file(p, NEWLINE, "CLASS", &c, NULL);
if (r < 0)
return r;
@@ -814,7 +814,7 @@ _public_ int sd_machine_get_ifindices(const char *machine, int **ifindices) {
assert_return(machine_name_is_valid(machine), -EINVAL);
assert_return(ifindices, -EINVAL);
- p = strappenda("/run/systemd/machines/", machine);
+ p = strjoina("/run/systemd/machines/", machine);
r = parse_env_file(p, NEWLINE, "NETIF", &netif, NULL);
if (r < 0)
return r;