SOURCES: hal-ck-api-change.patch (NEW) - fix for ConsoleKit API change

megabajt megabajt at pld-linux.org
Wed Aug 20 20:32:27 CEST 2008


Author: megabajt                     Date: Wed Aug 20 18:32:27 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fix for ConsoleKit API change

---- Files affected:
SOURCES:
   hal-ck-api-change.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/hal-ck-api-change.patch
diff -u /dev/null SOURCES/hal-ck-api-change.patch:1.1
--- /dev/null	Wed Aug 20 20:32:27 2008
+++ SOURCES/hal-ck-api-change.patch	Wed Aug 20 20:32:22 2008
@@ -0,0 +1,110 @@
+diff --git a/hald/ck-tracker.c b/hald/ck-tracker.c
+index 34aa640..7574e76 100644
+--- a/hald/ck-tracker.c
++++ b/hald/ck-tracker.c
+@@ -1,3 +1,4 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+ /***************************************************************************
+  * CVSID: $Id$
+  *
+@@ -255,11 +256,17 @@ ck_session_get_info (CKTracker *tracker, CKSession *session)
+ 			dbus_message_unref (reply);
+ 		goto error;
+ 	}
++	/* GetUnixUser API Changed in CK 0.3.0 */
+ 	if (!dbus_message_get_args (reply, NULL,
+-				    DBUS_TYPE_INT32, &(session->user),
++				    DBUS_TYPE_UINT32, &(session->user),
+ 				    DBUS_TYPE_INVALID)) {
+-		HAL_ERROR (("Invalid GetUnixUser reply from CK"));
+-		goto error;
++		/* try the older API */
++		if (!dbus_message_get_args (reply, NULL,
++					    DBUS_TYPE_INT32, &(session->user),
++					    DBUS_TYPE_INVALID)) {
++			HAL_ERROR (("Invalid GetUnixUser reply from CK"));
++			goto error;
++		}
+ 	}
+ 	dbus_message_unref (message);
+ 	dbus_message_unref (reply);
+@@ -530,11 +537,16 @@ ck_tracker_process_system_bus_message (CKTracker *tracker, DBusMessage *message)
+ 
+ 		seat_objpath = dbus_message_get_path (message);
+ 
++		/* API fixed in CK 0.3 to match spec */
+ 		if (!dbus_message_get_args (message, NULL,
+-					    DBUS_TYPE_STRING, &seat_objpath,
++					    DBUS_TYPE_OBJECT_PATH, &seat_objpath,
+ 					    DBUS_TYPE_INVALID)) {
+-			HAL_ERROR (("Invalid SeatAdded signal from CK"));
+-			goto out;
++			if (!dbus_message_get_args (message, NULL,
++						    DBUS_TYPE_STRING, &seat_objpath,
++						    DBUS_TYPE_INVALID)) {
++				HAL_ERROR (("Invalid SeatAdded signal from CK"));
++				goto out;
++			}
+ 		}
+ 
+ 		HAL_INFO (("Received SeatAdded '%s' from CK", seat_objpath));
+@@ -557,11 +569,16 @@ ck_tracker_process_system_bus_message (CKTracker *tracker, DBusMessage *message)
+ 
+ 		seat_objpath = dbus_message_get_path (message);
+ 
++		/* API fixed in CK 0.3 to match spec */
+ 		if (!dbus_message_get_args (message, NULL,
+-					    DBUS_TYPE_STRING, &seat_objpath,
++					    DBUS_TYPE_OBJECT_PATH, &seat_objpath,
+ 					    DBUS_TYPE_INVALID)) {
+-			HAL_ERROR (("Invalid SeatRemoved signal from CK"));
+-			goto out;
++			if (!dbus_message_get_args (message, NULL,
++						    DBUS_TYPE_STRING, &seat_objpath,
++						    DBUS_TYPE_INVALID)) {
++				HAL_ERROR (("Invalid SeatRemoved signal from CK"));
++				goto out;
++			}
+ 		}
+ 
+ 		HAL_INFO (("Received SeatRemoved '%s' from CK", seat_objpath));
+@@ -587,11 +604,16 @@ ck_tracker_process_system_bus_message (CKTracker *tracker, DBusMessage *message)
+ 
+ 		seat_objpath = dbus_message_get_path (message);
+ 
++		/* API fixed in CK 0.3 to match spec */
+ 		if (!dbus_message_get_args (message, NULL,
+-					    DBUS_TYPE_STRING, &session_objpath,
++					    DBUS_TYPE_OBJECT_PATH, &session_objpath,
+ 					    DBUS_TYPE_INVALID)) {
+-			HAL_ERROR (("Invalid SessionAdded signal from CK"));
+-			goto out;
++			if (!dbus_message_get_args (message, NULL,
++						    DBUS_TYPE_STRING, &session_objpath,
++						    DBUS_TYPE_INVALID)) {
++				HAL_ERROR (("Invalid SessionAdded signal from CK"));
++				goto out;
++			}
+ 		}
+ 
+ 		HAL_INFO (("Received SessionAdded '%s' from CK on seat '%s'", session_objpath, seat_objpath));
+@@ -623,11 +645,16 @@ ck_tracker_process_system_bus_message (CKTracker *tracker, DBusMessage *message)
+ 
+ 		seat_objpath = dbus_message_get_path (message);
+ 
++		/* API fixed in CK 0.3 to match spec */
+ 		if (!dbus_message_get_args (message, NULL,
+-					    DBUS_TYPE_STRING, &session_objpath,
++					    DBUS_TYPE_OBJECT_PATH, &session_objpath,
+ 					    DBUS_TYPE_INVALID)) {
+-			HAL_ERROR (("Invalid SessionRemoved signal from CK"));
+-			goto out;
++			if (!dbus_message_get_args (message, NULL,
++						    DBUS_TYPE_STRING, &session_objpath,
++						    DBUS_TYPE_INVALID)) {
++				HAL_ERROR (("Invalid SessionRemoved signal from CK"));
++				goto out;
++			}
+ 		}
+ 
+ 		HAL_INFO (("Received SessionRemoved '%s' from CK on seat '%s'", session_objpath, seat_objpath));
================================================================


More information about the pld-cvs-commit mailing list