mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-27 22:58:26 +02:00
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 |
||
|---|---|---|
| .. | ||
| Makefile.am | ||
| up-autocleanups.h | ||
| up-client.c | ||
| up-client.h | ||
| up-device.c | ||
| up-device.h | ||
| up-history-item.c | ||
| up-history-item.h | ||
| up-stats-item.c | ||
| up-stats-item.h | ||
| up-types.c | ||
| up-types.h | ||
| up-version.h.in | ||
| up-wakeup-item.c | ||
| up-wakeup-item.h | ||
| up-wakeups.c | ||
| up-wakeups.h | ||
| upower.h | ||