From 1708094c0e00ab433bb0a51981f8b77d24aee256 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Wed, 9 Apr 2003 20:31:21 +0000 Subject: 2003-04-09 Havoc Pennington * dbus/dbus-bus.c (dbus_bus_register): fix up error handling and a memory leak * bus/dispatch.c (check_service_activated): fix bug in test * dbus/dbus-mainloop.c (check_timeout): fix this up * dbus/dbus-internals.c (_dbus_verbose_real): include PID in verbose output so we can sort out output from different processes, e.g. in the activation case. --- bus/dispatch.c | 18 ++++++++++++++---- bus/driver.c | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'bus') diff --git a/bus/dispatch.c b/bus/dispatch.c index 4761a4bd..0b9f9731 100644 --- a/bus/dispatch.c +++ b/bus/dispatch.c @@ -1111,9 +1111,10 @@ check_service_activated (BusContext *context, goto recheck_service_created; } - else if (require_base_service) + else if (require_base_service && !already_saw_base_created) { - _dbus_warn ("Did not get a ServiceCreated for a base service\n"); + _dbus_warn ("Did not get a ServiceCreated for a base service, it was for %s instead\n", + service_name); goto out; } @@ -1228,7 +1229,7 @@ check_service_deactivated (BusContext *context, /* Now we are expecting ServiceDeleted messages for the base * service and the activated_name. The base service - * notification is required to come second. + * notification is required to come last. */ csdd.expected_service_name = activated_name; csdd.failed = FALSE; @@ -1251,6 +1252,8 @@ check_service_deactivated (BusContext *context, _dbus_warn ("Messages were left over after verifying results of service exiting\n"); goto out; } + + retval = TRUE; out: if (message) @@ -1351,6 +1354,13 @@ check_existent_service_activation (BusContext *context, { ; /* good, this is expected also */ } + else if (dbus_message_name_is (message, + DBUS_ERROR_SPAWN_CHILD_EXITED)) + { + ; /* good, this is expected also (child will exit if for example we don't + * have memory to register it) + */ + } else { _dbus_warn ("Did not expect error %s\n", @@ -1401,7 +1411,7 @@ check_existent_service_activation (BusContext *context, /* and process everything again */ bus_test_run_everything (context); - + if (!check_service_deactivated (context, connection, EXISTENT_SERVICE_NAME, base_service)) goto out; diff --git a/bus/driver.c b/bus/driver.c index 31b848e9..a3fe7c59 100644 --- a/bus/driver.c +++ b/bus/driver.c @@ -467,6 +467,8 @@ bus_driver_handle_acquire_service (DBusConnection *connection, dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED, "Cannot acquire a service starting with ':' such as \"%s\"", name); + + _dbus_verbose ("Attempt to acquire invalid base service name \"%s\"", name); goto out; } -- cgit