[systemd-commits] 2 commits - src/load-fragment.c src/socket.c TODO

Lennart Poettering lennart at kemper.freedesktop.org
Fri Apr 15 18:42:45 PDT 2011


 TODO                |    6 ------
 src/load-fragment.c |    9 +++++++--
 src/socket.c        |    2 +-
 3 files changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 94bc27318a258f460bc9dfa641737324c62b4759
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Apr 16 03:42:37 2011 +0200

    socket: reuse existing FIFOs

diff --git a/src/socket.c b/src/socket.c
index 01af34c..94991a3 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -715,7 +715,7 @@ static int fifo_address_create(
         r = mkfifo(path, socket_mode);
         umask(old_mask);
 
-        if (r < 0) {
+        if (r < 0 && errno != EEXIST) {
                 r = -errno;
                 goto fail;
         }

commit 49f91047afb48b8ee5728c68ba75782463176fd4
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Apr 16 03:42:18 2011 +0200

    socket: guarantee order in which sockets are passed to be the one of the configuration file

diff --git a/TODO b/TODO
index 2070a74..80faf0f 100644
--- 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
diff --git a/src/load-fragment.c b/src/load-fragment.c
index a7e16ca..c48d764 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -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;
 }



More information about the systemd-commits mailing list