]> err.no Git - systemd/commitdiff
socket: guarantee order in which sockets are passed to be the one of the configuratio...
authorLennart Poettering <lennart@poettering.net>
Sat, 16 Apr 2011 01:42:18 +0000 (03:42 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 16 Apr 2011 01:42:18 +0000 (03:42 +0200)
TODO
src/load-fragment.c

diff --git a/TODO b/TODO
index 2070a749130de7d580490588d8c2d9fa0ec6e4ec..80faf0fa3f17a641f26e421afb1b05475d4103f9 100644 (file)
--- a/TODO
+++ b/TODO
@@ -36,12 +36,6 @@ Features:
 
 * use pivot_root on shutdown so that we can unmount the root directory.
 
-* make sure multiple sockets in a .socket file appear in the order they are listed
-  currently we get:
-    [Socket]
-    ListenSequentialPacket=@/org/kernel/udev/udevd    --> 4
-    ListenNetlink=kobject-uevent 1                    --> 3
-
 * fix alsa mixer restore to not print error when no config is stored
 
 * show enablement status in systemctl status
index a7e16ca1b9f8da6762f2fa79286cf03c4f833f62..c48d764a31c4a51c9e766941ca69655f81af3e2e 100644 (file)
@@ -198,7 +198,7 @@ static int config_parse_listen(
                 void *data,
                 void *userdata) {
 
-        SocketPort *p;
+        SocketPort *p, *tail;
         Socket *s;
 
         assert(filename);
@@ -255,7 +255,12 @@ static int config_parse_listen(
         }
 
         p->fd = -1;
-        LIST_PREPEND(SocketPort, port, s->ports, p);
+
+        if (s->ports) {
+                LIST_FIND_TAIL(SocketPort, port, s->ports, tail);
+                LIST_INSERT_AFTER(SocketPort, port, s->ports, tail, p);
+        } else
+                LIST_PREPEND(SocketPort, port, s->ports, p);
 
         return 0;
 }