summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2016-06-16 08:47:56 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2016-06-21 15:18:30 +0200
commitdca9dec4b13c09398d075703868919845761e2d1 (patch)
tree68eeccd07c4df604b1182153312106318d44e7b5
parente0805fc686bfdc01f2026dfb02263a4351f8f301 (diff)
team: check return value of g_dbus_connection_call_sync()
The call can fail; in such case assume that an existing teamd died and our instance will be able to continue. https://bugzilla.redhat.com/show_bug.cgi?id=1347015 (cherry picked from commit 072358dad08b4b2206f15e6b0ebf9f096e81c05e) (cherry picked from commit 90677c1c66261126a8b5cdc0047eabcf335c663d)
-rw-r--r--src/devices/team/nm-device-team.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c
index b48ea99131..5e44acc367 100644
--- a/src/devices/team/nm-device-team.c
+++ b/src/devices/team/nm-device-team.c
@@ -344,10 +344,18 @@ teamd_dbus_appeared (GDBusConnection *connection,
2000,
NULL,
NULL);
- g_variant_get (ret, "(u)", &pid);
- if (pid != priv->teamd_pid)
- teamd_cleanup (device, FALSE);
+ if (ret) {
+ g_variant_get (ret, "(u)", &pid);
+ if (pid != priv->teamd_pid)
+ teamd_cleanup (device, FALSE);
+ } else {
+ _LOGW (LOGD_TEAM, "failed to determine D-Bus name owner");
+ /* If we can't determine the bus name owner, don't kill our
+ * teamd instance. Hopefully another existing teamd just died and
+ * our instance will be able to grab the bus name.
+ */
+ }
}
/* Grab a teamd control handle even if we aren't going to use it