mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-05 08:48:05 +02:00
read-only-mirror of https://gitlab.freedesktop.org/upower/upower
A GObject's _init() should never fail or block, but this is currently the case as up_client_init() connects to upowerd on D-Bus. Convert this to the GInitable interface and provide a new constructor up_client_new_full() which accepts a GCancellable and GError, so that clients can do proper error handling and reporting. This changes up_client_new() to return NULL when connecting to upowerd fails. This provides a more well-defined behaviour in this case as clients can check for this and our methods stop segfaulting as they have checks like g_return_val_if_fail (UP_IS_CLIENT (client), ...) Previously we returned a valid object, but trying to call any method on it segfaulted due to the NULL D-Bus proxy, so client code had no chance to check whether the UpClient object was really valid. https://bugs.freedesktop.org/show_bug.cgi?id=95350 |
||
|---|---|---|
| dbus | ||
| doc | ||
| etc | ||
| libupower-glib | ||
| m4 | ||
| po | ||
| rules | ||
| src | ||
| tools | ||
| AUTHORS | ||
| autogen.sh | ||
| configure.ac | ||
| COPYING | ||
| git.mk | ||
| HACKING | ||
| Makefile.am | ||
| NEWS | ||
| README | ||
| RELEASE | ||
| upower-glib.pc.in | ||
=============== UPower =============== Requirements: glib-2.0 >= 2.34.0 gio-2.0 >= 2.16.1 gudev-1.0 >= 147 (Linux) libusb-1.0 >= 1.0.0 (Linux) libimobiledevice-1.0 >= 0.9.7 (optional) UPower is an abstraction for enumerating power devices, listening to device events and querying history and statistics. Any application or service on the system can access the org.freedesktop.UPower service via the system message bus.