[gnome-settings-daemon] power: Avoid warnings without backlights
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] power: Avoid warnings without backlights
- Date: Thu, 8 Sep 2011 09:46:07 +0000 (UTC)
commit 06fc5dd9ed21c307ebb151d14097a533a5bcb4e5
Author: Bastien Nocera <hadess hadess net>
Date: Thu Sep 8 10:43:51 2011 +0100
power: Avoid warnings without backlights
We really want to set an error here, so that it can
be propagated to the screen panel in the gnome-control-center
properly.
plugins/power/gsd-power-manager.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 80afa87..72eae6b 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -2256,8 +2256,17 @@ backlight_helper_get_value (const gchar *argument, GError **error)
error);
g_debug ("executed %s retval: %i", command, exit_status);
- if (!ret || WEXITSTATUS (exit_status) != 0)
+ if (!ret)
+ goto out;
+
+ if (WEXITSTATUS (exit_status) != 0) {
+ g_set_error (error,
+ GSD_POWER_MANAGER_ERROR,
+ GSD_POWER_MANAGER_ERROR_FAILED,
+ "gsd-backlight-helper failed: %s",
+ stdout_data);
goto out;
+ }
/* parse */
value = g_ascii_strtoll (stdout_data, &endptr, 10);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]