diff -u gnome-power-manager-2.22.1/debian/changelog gnome-power-manager-2.22.1/debian/changelog --- gnome-power-manager-2.22.1/debian/changelog +++ gnome-power-manager-2.22.1/debian/changelog @@ -1,3 +1,10 @@ +gnome-power-manager (2.22.1-1ubuntu4.1) hardy-proposed; urgency=low + + * Add 75-ignore-long-failed-suspends.patch to prevent inaccurately + indicating failed suspends when they were >= 6 hours. (LP: #242713) + + -- Mario Limonciello Tue, 02 Sep 2008 17:40:15 -0500 + gnome-power-manager (2.22.1-1ubuntu4) hardy; urgency=low * Adding in patch 10_keyboard_brightness_gconf.patch which fixes some only in patch2: unchanged: --- gnome-power-manager-2.22.1.orig/debian/patches/75-ignore-long-failed-suspends.patch +++ gnome-power-manager-2.22.1/debian/patches/75-ignore-long-failed-suspends.patch @@ -0,0 +1,126 @@ +diff -Nur -x '*.orig' -x '*~' gnome-power-manager-2.22.1/libhal-glib/libhal-gpower.c gnome-power-manager-2.22.1.new/libhal-glib/libhal-gpower.c +--- gnome-power-manager-2.22.1/libhal-glib/libhal-gpower.c 2008-09-02 17:45:15.000000000 -0500 ++++ gnome-power-manager-2.22.1.new/libhal-glib/libhal-gpower.c 2008-09-02 17:47:54.000000000 -0500 +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + #include "libhal-marshal.h" + #include "libhal-gpower.h" +@@ -78,9 +79,8 @@ + HAL_DBUS_SERVICE, + HAL_ROOT_COMPUTER, + HAL_DBUS_INTERFACE_POWER); +- if (power->priv->gproxy == NULL) { ++ if (power->priv->gproxy == NULL) + g_warning ("HAL does not support power management!"); +- } + + power->priv->computer = hal_gdevice_new (); + hal_gdevice_set_udi (power->priv->computer, HAL_ROOT_COMPUTER); +@@ -204,9 +204,8 @@ + hal_gpower_filter_error (GError **error) + { + /* short cut for speed, no error */ +- if (error == NULL || *error == NULL) { ++ if (error == NULL || *error == NULL) + return FALSE; +- } + + /* DBUS might time out, which is okay. We can remove this code + when the dbus glib bindings are fixed. See #332888 */ +@@ -232,6 +231,8 @@ + gboolean + hal_gpower_suspend (HalGPower *power, guint wakeup, GError **error) + { ++ time_t start; ++ time_t end; + gint retval = 0; + gboolean ret; + DBusGProxy *proxy; +@@ -244,17 +245,24 @@ + return FALSE; + } + ++ time (&start); + ret = dbus_g_proxy_call (proxy, "Suspend", error, + G_TYPE_INT, wakeup, + G_TYPE_INVALID, + G_TYPE_INT, &retval, + G_TYPE_INVALID); + /* we might have to ignore the error */ +- if (error != NULL && hal_gpower_filter_error (error) == TRUE) { ++ if (error != NULL && hal_gpower_filter_error (error)) + return TRUE; +- } +- if (retval != 0) { +- g_warning ("Suspend failed in a horrible way!"); ++ if (retval != 0) ++ 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) */ ++ if (ret != 0) { ++ time (&end); ++ if (difftime (start, end) >= 6*60*60*1000) ++ return TRUE; + } + return ret; + } +@@ -272,6 +280,8 @@ + static gboolean + hal_gpower_pm_method_void (HalGPower *power, const gchar *method, GError **error) + { ++ time_t start; ++ time_t end; + guint retval = 0; + gboolean ret; + DBusGProxy *proxy; +@@ -279,6 +289,7 @@ + g_return_val_if_fail (LIBHAL_IS_GPOWER (power), FALSE); + g_return_val_if_fail (method != NULL, FALSE); + ++ + proxy = dbus_proxy_get_proxy (power->priv->gproxy); + if (DBUS_IS_G_PROXY (proxy) == FALSE) { + g_warning ("proxy NULL!!"); +@@ -289,16 +300,23 @@ + return FALSE; + } + ++ time (&start); + ret = dbus_g_proxy_call (proxy, method, error, + G_TYPE_INVALID, + G_TYPE_INT, &retval, + G_TYPE_INVALID); + /* we might have to ignore the error */ +- if (error != NULL && hal_gpower_filter_error (error) == TRUE) { ++ 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); ++ ++ /* 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) */ ++ if (ret != 0) { ++ time (&end); ++ if (difftime (start,end) >= 6*60*60*1000) ++ return TRUE; + } + return ret; + } +@@ -384,9 +402,8 @@ + G_TYPE_INVALID, + G_TYPE_INT, &retval, + G_TYPE_INVALID); +- if (retval != 0) { ++ if (retval != 0) + g_warning ("SetPowerSave failed in a horrible way!"); +- } + return ret; + } +