summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-10-18 18:41:30 +0200
committerBastien Nocera <hadess@hadess.net>2013-10-18 18:41:30 +0200
commit5be178ca5b770356d0412aff87e4696ff1a1afdf (patch)
treec6f6a1c1149c130094cf743ca5ccb1402f9388aa
parentcd52ad6d1c1a07dac424dd1e69efd0b1eaf31355 (diff)
downloadupower-5be178ca5b770356d0412aff87e4696ff1a1afdf.tar.gz
daemon: Don't get in a bad state when refresh fails
Failure to refresh was supposed to be non-fatal, but since we started putting objects on the bus *after* refresh, we were skipping the registration if refresh failed, as is the case in the UPS test case.
-rw-r--r--src/up-device.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/up-device.c b/src/up-device.c
index 6d09856..caccb3a 100644
--- a/src/up-device.c
+++ b/src/up-device.c
@@ -690,7 +690,7 @@ up_device_coldplug (UpDevice *device, UpDaemon *daemon, GObject *native)
ret = klass->coldplug (device);
if (!ret) {
g_debug ("failed to coldplug %s", device->priv->native_path);
- goto out;
+ goto bail;
}
}
@@ -701,7 +701,6 @@ up_device_coldplug (UpDevice *device, UpDaemon *daemon, GObject *native)
/* TODO: refresh should really have separate
* success _and_ changed parameters */
- ret = TRUE;
goto out;
}
@@ -711,15 +710,14 @@ up_device_coldplug (UpDevice *device, UpDaemon *daemon, GObject *native)
up_history_set_id (device->priv->history, id);
g_free (id);
}
-
+out:
/* only put on the bus if we succeeded */
ret = up_device_register_device (device);
if (!ret) {
g_warning ("failed to register device %s", device->priv->native_path);
goto out;
}
-
-out:
+bail:
return ret;
}