]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: shorten list appending a bit, by using better macros
authorLennart Poettering <lennart@poettering.net>
Wed, 17 Oct 2018 19:06:09 +0000 (21:06 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 Oct 2018 19:13:02 +0000 (21:13 +0200)
src/core/dbus-socket.c

index a1d1b0c6f82902b69311922a22baeb61f88cf379..dc87e22b2912d6096ed42c95597f00226b1af117 100644 (file)
@@ -395,13 +395,7 @@ static int bus_socket_set_transient_property(
                         empty = false;
 
                         if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
-                                SocketPort *tail;
-
-                                LIST_FIND_TAIL(port, s->ports, tail);
-                                LIST_INSERT_AFTER(port, s->ports, tail, p);
-
-                                p = NULL;
-
+                                LIST_APPEND(port, s->ports, TAKE_PTR(p));
                                 unit_write_settingf(u, flags|UNIT_ESCAPE_SPECIFIERS, name, "Listen%s=%s", t, a);
                         }
                 }