hal/libhal libhal.c,1.41,1.42

David Zeuthen david at freedesktop.org
Wed Feb 23 09:55:25 PST 2005


Update of /cvs/hal/hal/libhal
In directory gabe:/tmp/cvs-serv29432/libhal

Modified Files:
	libhal.c 
Log Message:
2005-02-23  David Zeuthen  <davidz at redhat.com>

	* libhal/libhal.c (libhal_ctx_init): Add a small fix here wrt.
	error handling



Index: libhal.c
===================================================================
RCS file: /cvs/hal/hal/libhal/libhal.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- libhal.c	22 Feb 2005 22:00:45 -0000	1.41
+++ libhal.c	23 Feb 2005 17:55:23 -0000	1.42
@@ -2750,7 +2750,7 @@
 dbus_bool_t 
 libhal_ctx_init (LibHalContext *ctx, DBusError *error)
 {
-	DBusError myerror;
+	DBusError _error;
 
 	if (ctx == NULL)
 		return FALSE;
@@ -2760,22 +2760,18 @@
 
 	
 	if (!dbus_connection_add_filter (ctx->connection, filter_func, ctx, NULL)) {
-		fprintf (stderr, "%s %d : Error creating connection handler\r\n", __FILE__, __LINE__);
-		/** @todo  clean up */
 		return FALSE;
 	}
 
-	dbus_error_init (&myerror);
+	dbus_error_init (&_error);
 	dbus_bus_add_match (ctx->connection, 
 			    "type='signal',"
 			    "interface='org.freedesktop.Hal.Manager',"
 			    "sender='org.freedesktop.Hal',"
-			    "path='/org/freedesktop/Hal/Manager'", &myerror);
-	if (dbus_error_is_set (&myerror)) {
-		fprintf (stderr, "%s %d : Error subscribing to signals, error=%s\n", 
-			 __FILE__, __LINE__, error->message);
-		/** @todo  clean up */
-		/*return FALSE;*/
+			    "path='/org/freedesktop/Hal/Manager'", &_error);
+	dbus_move_error (&_error, error);
+	if (error != NULL && dbus_error_is_set (error)) {
+		return FALSE;
 	}
 	ctx->is_initialized = TRUE;
 




More information about the hal-commit mailing list