Michael Biebl wrote:
What about the attached patch hal_killswitch.patch instead, which adds a configure check and some ifdefs. I tested it with hal 0.5.10 and It's
Which I just noticed, can be simplified a patch. Please find an updated patch attached.
Cheers, Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
Index: src/NetworkManager.c
===================================================================
--- src/NetworkManager.c (Revision 3227)
+++ src/NetworkManager.c (Arbeitskopie)
@@ -341,8 +341,11 @@
{
DBusError err;
DBusMessage * reply = NULL;
- gint32 int_status = 1;
- guint32 uint_status = 1;
+#ifdef HAVE_HAL_0_5_10
+ gint32 status = 1;
+#else
+ guint32 status = 1;
+#endif
g_return_if_fail (pcall != NULL);
g_return_if_fail (data != NULL);
@@ -368,23 +371,20 @@
/* Handle both HAL <= 0.5.9 which uses UINT and HAL >= 0.5.10 which
* uses INT.
*/
- if (!dbus_message_get_args (reply, &err, DBUS_TYPE_UINT32, &uint_status, DBUS_TYPE_INVALID)) {
+#ifdef HAVE_HAL_0_5_10
+ if (!dbus_message_get_args (reply, &err, DBUS_TYPE_INT32, &status, DBUS_TYPE_INVALID)) {
+#else
+ if (!dbus_message_get_args (reply, &err, DBUS_TYPE_UINT32, &status, DBUS_TYPE_INVALID)) {
+#endif
+ if (!ks_err_message || strcmp (ks_err_message, err.message)) {
+ nm_info ("Error getting killswitch power arguments: %s - %s", err.name, err.message);
+ g_free (ks_err_message);
+ ks_err_message = g_strdup (err.message);
+ }
dbus_error_free (&err);
-
- if (!dbus_message_get_args (reply, &err, DBUS_TYPE_INT32, &int_status, DBUS_TYPE_INVALID)) {
- if (!ks_err_message || strcmp (ks_err_message, err.message)) {
- nm_info ("Error getting killswitch power arguments: %s - %s", err.name, err.message);
- g_free (ks_err_message);
- ks_err_message = g_strdup (err.message);
- }
- dbus_error_free (&err);
- goto out;
- } else {
- if (int_status == 0)
- data->tmp_hw_rf_enabled = FALSE;
- }
+ goto out;
} else {
- if (uint_status == 0)
+ if (status == 0)
data->tmp_hw_rf_enabled = FALSE;
}
Index: configure.in
===================================================================
--- configure.in (Revision 3227)
+++ configure.in (Arbeitskopie)
@@ -144,6 +144,11 @@
PKG_CHECK_MODULES(HAL, hal >= 0.5.0)
+PKG_CHECK_EXISTS([hal >= 0.5.10],[have_hal_0_5_10=yes],[have_hal_0_5_10=no])
+if test "$have_hal_0_5_10" = "yes"; then
+ AC_DEFINE([HAVE_HAL_0_5_10],[1],[Define if we have hal 0.5.10 or newer])
+fi
+
if test x"$with_gnome" != xno; then
PKG_CHECK_MODULES(GTK, gtk+-2.0)
Attachment:
signature.asc
Description: OpenPGP digital signature