diff options
author | Mike Gilbert <floppym@gentoo.org> | 2018-04-18 12:50:39 -0400 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2018-04-18 12:50:55 -0400 |
commit | 92f2fa6fd24ae18ecafeab68ffd72eddc028325f (patch) | |
tree | 54d918e8705ae2c9d3e9c8fbc8be7b757092123b /sys-apps/systemd | |
parent | net-p2p/vuze: EAPI 6 bump. (diff) | |
download | gentoo-92f2fa6fd24ae18ecafeab68ffd72eddc028325f.tar.gz gentoo-92f2fa6fd24ae18ecafeab68ffd72eddc028325f.tar.bz2 gentoo-92f2fa6fd24ae18ecafeab68ffd72eddc028325f.zip |
sys-apps/systemd: backport timesync fix
Package-Manager: Portage-2.3.24, Repoman-2.3.6_p81
Diffstat (limited to 'sys-apps/systemd')
-rw-r--r-- | sys-apps/systemd/files/238-timesync-connection.patch | 49 | ||||
-rw-r--r-- | sys-apps/systemd/systemd-238-r6.ebuild (renamed from sys-apps/systemd/systemd-238-r5.ebuild) | 1 |
2 files changed, 50 insertions, 0 deletions
diff --git a/sys-apps/systemd/files/238-timesync-connection.patch b/sys-apps/systemd/files/238-timesync-connection.patch new file mode 100644 index 000000000000..a48a88e9e68d --- /dev/null +++ b/sys-apps/systemd/files/238-timesync-connection.patch @@ -0,0 +1,49 @@ +From 6d254dba01491b994115ecef8c4017fbe5451606 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe <watanabe.yu+github@gmail.com> +Date: Mon, 16 Apr 2018 12:24:36 +0900 +Subject: [PATCH] timesync: establish connection when network become online and + the manager is not connected yet + +This also introduces `manager_is_connected()` helper function, which +returns true when the manager is sending a request, resolving a server +name, or in a poll interval. + +Follow-up for 3e85ec072180b6fbec82d715186985536859a29d. +Fixes #8719. +--- + src/timesync/timesyncd-manager.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c +index cfdc43b0ff2..0c5d3e2d6f7 100644 +--- a/src/timesync/timesyncd-manager.c ++++ b/src/timesync/timesyncd-manager.c +@@ -1036,6 +1036,12 @@ static int manager_network_read_link_servers(Manager *m) { + return r; + } + ++static bool manager_is_connected(Manager *m) { ++ /* Return true when the manager is sending a request, resolving a server name, or ++ * in a poll interval. */ ++ return m->server_socket >= 0 || m->resolve_query || m->event_timer; ++} ++ + static int manager_network_event_handler(sd_event_source *s, int fd, uint32_t revents, void *userdata) { + Manager *m = userdata; + bool changed, connected, online; +@@ -1051,13 +1057,13 @@ static int manager_network_event_handler(sd_event_source *s, int fd, uint32_t re + online = network_is_online(); + + /* check if the client is currently connected */ +- connected = m->server_socket >= 0 || m->resolve_query || m->exhausted_servers; ++ connected = manager_is_connected(m); + + if (connected && !online) { + log_info("No network connectivity, watching for changes."); + manager_disconnect(m); + +- } else if (!connected && online && changed) { ++ } else if ((!connected || changed) && online) { + log_info("Network configuration changed, trying to establish connection."); + + if (m->current_server_address) diff --git a/sys-apps/systemd/systemd-238-r5.ebuild b/sys-apps/systemd/systemd-238-r6.ebuild index 6d0ee7602a80..8625668cfff4 100644 --- a/sys-apps/systemd/systemd-238-r5.ebuild +++ b/sys-apps/systemd/systemd-238-r6.ebuild @@ -155,6 +155,7 @@ src_prepare() { PATCHES+=( "${FILESDIR}/238-initctl.patch" "${FILESDIR}/238-nspawn-wait.patch" + "${FILESDIR}/238-timesync-connection.patch" ) if ! use vanilla; then |