summaryrefslogtreecommitdiff
path: root/src/gpm-button.c
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2024-10-02 12:03:58 +0200
committerColomban Wendling <[email protected]>2024-10-02 12:03:58 +0200
commit3027b2e231b0fcefa9ab7c58bef163f1e967ee2b (patch)
treed3614452ad1bae5a13719337cf7db44ebf5c05ee /src/gpm-button.c
parent1a3b70bbe58355684cf896449fd0405fc05fdc2b (diff)
downloadmate-power-manager-3027b2e231b0fcefa9ab7c58bef163f1e967ee2b.tar.bz2
mate-power-manager-3027b2e231b0fcefa9ab7c58bef163f1e967ee2b.tar.xz
button: Don't error-out on dbus communication failure
Diffstat (limited to 'src/gpm-button.c')
-rw-r--r--src/gpm-button.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gpm-button.c b/src/gpm-button.c
index c440c5b..c2e0532 100644
--- a/src/gpm-button.c
+++ b/src/gpm-button.c
@@ -270,9 +270,9 @@ gpm_button_is_lid_closed (GpmButton *button)
NULL,
&error );
if (proxy == NULL) {
- g_error("Error connecting to dbus - %s", error->message);
+ g_warning ("Error connecting to dbus - %s", error->message);
g_error_free (error);
- return -1;
+ goto err;
}
res = g_dbus_proxy_call_sync (proxy, "Get",
@@ -292,15 +292,16 @@ gpm_button_is_lid_closed (GpmButton *button)
g_variant_unref (res);
return lid;
} else if (error != NULL ) {
- g_error ("Error in dbus - %s", error->message);
+ g_warning ("Error in dbus - %s", error->message);
g_error_free (error);
+ goto err;
}
return FALSE;
}
- else {
- return up_client_get_lid_is_closed (button->priv->client);
- }
+
+err: /* fall back on our client in case of error */
+ return up_client_get_lid_is_closed (button->priv->client);
}
/**