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.
This commit is contained in:
Lennart Poettering
2015-02-03 02:05:59 +01:00
parent 44de0efc6e
commit 63c372cb9d
75 changed files with 248 additions and 237 deletions
+2 -2
View File
@@ -266,7 +266,7 @@ static int socket_add_device_link(Socket *s) {
if (!s->bind_to_device || streq(s->bind_to_device, "lo"))
return 0;
t = strappenda("/sys/subsystem/net/devices/", s->bind_to_device);
t = strjoina("/sys/subsystem/net/devices/", s->bind_to_device);
return unit_add_node_link(UNIT(s), t, false);
}
@@ -473,7 +473,7 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
assert(f);
prefix = strempty(prefix);
prefix2 = strappenda(prefix, "\t");
prefix2 = strjoina(prefix, "\t");
fprintf(f,
"%sSocket State: %s\n"