1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 08:26:52 +03:00

timesyncd: keep order of NTP servers

This commit is contained in:
Lennart Poettering 2014-05-06 12:34:03 +02:00
parent 1df52dd282
commit 600809211e

View File

@ -935,7 +935,7 @@ static int manager_connect(Manager *m) {
}
static int manager_add_server(Manager *m, const char *server) {
ServerName *n;
ServerName *n, *tail;
assert(m);
assert(server);
@ -950,7 +950,12 @@ static int manager_add_server(Manager *m, const char *server) {
return -ENOMEM;
}
if (m->servers) {
LIST_FIND_TAIL(names, m->servers, tail);
LIST_INSERT_AFTER(names, m->servers, tail, n);
} else
LIST_PREPEND(names, m->servers, n);
return 0;
}