summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}
/**