chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
socket: guarantee order in which sockets are passed to be the one of the configuratio...
[elogind.git]
/
src
/
load-fragment.c
diff --git
a/src/load-fragment.c
b/src/load-fragment.c
index a7e16ca1b9f8da6762f2fa79286cf03c4f833f62..c48d764a31c4a51c9e766941ca69655f81af3e2e 100644
(file)
--- a/
src/load-fragment.c
+++ b/
src/load-fragment.c
@@
-198,7
+198,7
@@
static int config_parse_listen(
void *data,
void *userdata) {
void *data,
void *userdata) {
- SocketPort *p;
+ SocketPort *p
, *tail
;
Socket *s;
assert(filename);
Socket *s;
assert(filename);
@@
-255,7
+255,12
@@
static int config_parse_listen(
}
p->fd = -1;
}
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;
}
return 0;
}