From 154dcd948a880dd8cc8029cf9efb1c1f527cf8b2 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 2 Oct 2013 18:12:20 +0200 Subject: [PATCH] team: fix startup of team by ignoring teamd_dbus_vanished at first g_bus_watch_name immediatly emits a vanished signal, if the name does not exist at the begining. So the first signal, does not indicate an actual change of state and must be ignored. Signed-off-by: Thomas Haller --- src/devices/nm-device-team.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/devices/nm-device-team.c b/src/devices/nm-device-team.c index 82e59bcea5..78aa7ab0a9 100644 --- a/src/devices/nm-device-team.c +++ b/src/devices/nm-device-team.c @@ -320,6 +320,18 @@ teamd_dbus_vanished (GDBusConnection *connection, g_return_if_fail (priv->teamd_dbus_watch); + if (priv->teamd_timeout) { + /* g_bus_watch_name will always raise an initial signal, to indicate whether the + * name exists/not exists initially. Do not take this as a failure, until the + * startup timeout is over. + * + * Note that g_bus_watch_name is guaranteed to alternate vanished/appeared signals, + * so we won't hit this condition again (because the next signal is either 'appeared' + * or 'timeout'). */ + nm_log_dbg (LOGD_TEAM, "(%s): teamd vanished from D-Bus (ignored)", nm_device_get_iface (dev)); + return; + } + nm_log_info (LOGD_TEAM, "(%s): teamd vanished from D-Bus", nm_device_get_iface (dev)); teamd_cleanup (dev);