mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-02-06 23:20:33 +01:00
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.
This commit is contained in:
parent
cd52ad6d1c
commit
5be178ca5b
1 changed files with 3 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue