summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-04-16 03:42:18 +0200
committerLennart Poettering <lennart@poettering.net>2011-04-16 03:42:18 +0200
commit49f91047afb48b8ee5728c68ba75782463176fd4 (patch)
tree0716937a2cad68b3e0ee9b9f165d056bc2375d8c /src
parent3d3961f26770b2949a30a72457e1660969bc17b8 (diff)
socket: guarantee order in which sockets are passed to be the one of the configuration file
Diffstat (limited to 'src')
-rw-r--r--src/load-fragment.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/load-fragment.c b/src/load-fragment.c
index a7e16ca1b9..c48d764a31 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;
}