hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Mon Nov 13 06:54:46 PST 2006


 libhal/libhal.c |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

New commits:
diff-tree 984a8a9d3c82ae948aedcd3bb8136ee65aca3b2e (from cd33ada3027bd96f4292d316fd0c346a55914b2f)
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Mon Nov 13 15:54:31 2006 +0100

    fixed usage of dbus_error_is_set(error == NULL) due to D-Bus changes
    
    This patch fixes the usage of dbus_error_is_set(error) if the error is NULL.
    Added check to be sure the lib don't call dbus_error_is_set() if the error is
    NULL, otherwise the call crash.

diff --git a/libhal/libhal.c b/libhal/libhal.c
index e88ca3d..49ac5c4 100644
--- a/libhal/libhal.c
+++ b/libhal/libhal.c
@@ -1457,7 +1457,7 @@ libhal_device_set_property_helper (LibHa
 	reply = dbus_connection_send_with_reply_and_block (ctx->connection,
 							   message, -1,
 							   error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -1650,7 +1650,7 @@ libhal_device_property_strlist_append (L
 	reply = dbus_connection_send_with_reply_and_block (ctx->connection,
 							   message, -1,
 							   error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -1703,7 +1703,7 @@ libhal_device_property_strlist_prepend (
 	reply = dbus_connection_send_with_reply_and_block (ctx->connection,
 							   message, -1,
 							   error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -1756,7 +1756,7 @@ libhal_device_property_strlist_remove_in
 	reply = dbus_connection_send_with_reply_and_block (ctx->connection,
 							   message, -1,
 							   error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -1808,7 +1808,7 @@ libhal_device_property_strlist_remove (L
 	reply = dbus_connection_send_with_reply_and_block (ctx->connection,
 							   message, -1,
 							   error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -1867,7 +1867,7 @@ libhal_device_lock (LibHalContext *ctx,
 							   message, -1,
 							   error);
 
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		if (strcmp (error->name,
 			    "org.freedesktop.Hal.DeviceAlreadyLocked") == 0) {
 			if (reason_why_locked != NULL) {
@@ -1928,7 +1928,7 @@ libhal_device_unlock (LibHalContext *ctx
 							   message, -1,
 							   error);
 
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -1983,7 +1983,7 @@ libhal_new_device (LibHalContext *ctx, D
 	reply = dbus_connection_send_with_reply_and_block (ctx->connection,
 							   message, -1,
 							   error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return NULL;
 	}
@@ -2066,7 +2066,7 @@ libhal_device_commit_to_gdl (LibHalConte
 	reply = dbus_connection_send_with_reply_and_block (ctx->connection,
 							   message, -1,
 							   error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -2122,7 +2122,7 @@ libhal_remove_device (LibHalContext *ctx
 	reply = dbus_connection_send_with_reply_and_block (ctx->connection,
 							   message, -1,
 							   error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -2314,7 +2314,7 @@ libhal_merge_properties (LibHalContext *
 	reply = dbus_connection_send_with_reply_and_block (ctx->connection,
 							   message, -1,
 							   error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -2604,7 +2604,7 @@ libhal_device_add_capability (LibHalCont
 	reply = dbus_connection_send_with_reply_and_block (ctx->connection,
 							   message, -1,
 							   error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -2744,7 +2744,7 @@ libhal_device_property_watch_all (LibHal
 			    "type='signal',"
 			    "interface='org.freedesktop.Hal.Device',"
 			    "sender='org.freedesktop.Hal'", error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		return FALSE;
 	}
 	return TRUE;
@@ -2778,7 +2778,7 @@ libhal_device_add_property_watch (LibHal
 		  "sender='org.freedesktop.Hal'," "path=%s", udi);
 
 	dbus_bus_add_match (ctx->connection, buf, error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		return FALSE;
 	}
 	return TRUE;
@@ -2808,7 +2808,7 @@ libhal_device_remove_property_watch (Lib
 		  "sender='org.freedesktop.Hal'," "path=%s", udi);
 
 	dbus_bus_remove_match (ctx->connection, buf, error);
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		return FALSE;
 	}
 	return TRUE;
@@ -3223,7 +3223,7 @@ libhal_device_rescan (LibHalContext *ctx
 							   message, -1,
 							   error);
 
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -3283,7 +3283,7 @@ libhal_device_reprobe (LibHalContext *ct
 							   message, -1,
 							   error);
 
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -3354,7 +3354,7 @@ dbus_bool_t libhal_device_emit_condition
 							   message, -1,
 							   error);
 
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -3420,7 +3420,7 @@ libhal_device_addon_is_ready (LibHalCont
 							   message, -1,
 							   error);
 
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}
@@ -3491,7 +3491,7 @@ libhal_device_claim_interface (LibHalCon
 							   message, -1,
 							   error);
 
-	if (dbus_error_is_set (error)) {
+	if (error != NULL && dbus_error_is_set (error)) {
 		dbus_message_unref (message);
 		return FALSE;
 	}


More information about the hal-commit mailing list