diff -u gnome-power-manager-2.24.2/debian/changelog gnome-power-manager-2.24.2/debian/changelog --- gnome-power-manager-2.24.2/debian/changelog +++ gnome-power-manager-2.24.2/debian/changelog @@ -1,3 +1,10 @@ +gnome-power-manager (2.24.2-2ubuntu9) jaunty; urgency=low + + * debian/patches/99_report_hibernate_suspend_errors: report suspend and + hibernate errors. LP: 374919. + + -- Andy Whitcroft Fri, 08 May 2009 15:26:04 +0100 + gnome-power-manager (2.24.2-2ubuntu8) jaunty; urgency=low [ Cody Russell ] diff -u gnome-power-manager-2.24.2/debian/patches/series gnome-power-manager-2.24.2/debian/patches/series --- gnome-power-manager-2.24.2/debian/patches/series +++ gnome-power-manager-2.24.2/debian/patches/series @@ -30,0 +31 @@ +99_report_hibernate_suspend_errors unchanged: --- gnome-power-manager-2.24.2.orig/debian/patches/99_report_hibernate_suspend_errors +++ gnome-power-manager-2.24.2/debian/patches/99_report_hibernate_suspend_errors @@ -0,0 +1,81 @@ +Index: gnome-power-manager-2.24.2/libhal-glib/libhal-gpower.c +=================================================================== +--- gnome-power-manager-2.24.2.orig/libhal-glib/libhal-gpower.c 2009-05-08 17:00:50.000000000 +0100 ++++ gnome-power-manager-2.24.2/libhal-glib/libhal-gpower.c 2009-05-08 17:13:10.000000000 +0100 +@@ -51,6 +51,20 @@ + G_DEFINE_TYPE (HalGPower, hal_gpower, G_TYPE_OBJECT) + + /** ++ * hal_error_quark: ++ * Return value: Our personal error quark. ++ **/ ++GQuark ++hal_gpower_quark (void) ++{ ++ static GQuark quark = 0; ++ if (!quark) { ++ quark = g_quark_from_static_string ("hal_gpower_error"); ++ } ++ return quark; ++} ++ ++/** + * hal_gpower_class_init: + * @klass: This class instance + **/ +@@ -254,8 +268,12 @@ + /* we might have to ignore the error */ + if (error != NULL && hal_gpower_filter_error (error)) + return TRUE; +- if (retval != 0) ++ if (retval != 0) { ++ g_set_error (error, HAL_GPOWER_ERROR, HAL_GPOWER_ERROR_GENERAL, ++ _("Suspend failed (exited %d)"), retval); ++ ret = FALSE; + g_warning ("Suspend failed without error message"); ++ } + + /* compare the amount of time that has passed - if it's more than 6 hours + * then the dbus call timed out (dbus-pending-call.c) */ +@@ -308,8 +326,12 @@ + /* we might have to ignore the error */ + if (error != NULL && hal_gpower_filter_error (error)) + return TRUE; +- if (retval != 0) ++ if (retval != 0) { + g_warning ("%s failed in a horrible way!", method); ++ g_set_error (error, HAL_GPOWER_ERROR, HAL_GPOWER_ERROR_GENERAL, ++ _("%s failed (exited %d)"), method, retval); ++ ret = FALSE; ++ } + + /* compare the amount of time that has passed - if it's more than 6 hours + * then the dbus call timed out (dbus-pending-call.c) */ +Index: gnome-power-manager-2.24.2/libhal-glib/libhal-gpower.h +=================================================================== +--- gnome-power-manager-2.24.2.orig/libhal-glib/libhal-gpower.h 2009-05-08 17:14:08.000000000 +0100 ++++ gnome-power-manager-2.24.2/libhal-glib/libhal-gpower.h 2009-05-08 17:13:53.000000000 +0100 +@@ -46,8 +46,11 @@ + GObjectClass parent_class; + } HalGPowerClass; + ++#define HAL_GPOWER_ERROR hal_gpower_quark () ++ + GType hal_gpower_get_type (void); + HalGPower *hal_gpower_new (void); ++GQuark hal_gpower_quark (void); + + gboolean hal_gpower_has_support (HalGPower *power); + gboolean hal_gpower_can_suspend (HalGPower *power); +@@ -72,6 +75,11 @@ + gboolean hal_gpower_enable_power_save (HalGPower *power, + gboolean enable); + ++typedef enum ++{ ++ HAL_GPOWER_ERROR_GENERAL ++} HalGpowerError; ++ + G_END_DECLS + + #endif /* __LIBGPOWER_H */