summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-04-11 03:58:56 +0000
committerHavoc Pennington <hp@redhat.com>2003-04-11 03:58:56 +0000
commita03e626728db8a9cbe1dbbfab6f22f5870cb40ae (patch)
tree474f7137f4cddd8951c5d3bb50dcaaeda8e91360
parent78e79022316f45e86a6cac4da85d6b60f5a8f7f8 (diff)
2003-04-11 Havoc Pennington <hp@pobox.com>
* bus/dispatch.c (check_existent_service_activation): accept a no memory error in a place we didn't before * bus/test.c (bus_test_run_everything): remove hacky "do it twice in case the first one failed," since the test suite is less broken now.
-rw-r--r--ChangeLog11
-rw-r--r--bus/dispatch.c36
-rw-r--r--bus/test.c13
3 files changed, 42 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 26aa048f..533672c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-04-11 Havoc Pennington <hp@pobox.com>
+
+ * bus/dispatch.c (check_existent_service_activation): accept a no
+ memory error in a place we didn't before
+
+ * bus/test.c (bus_test_run_everything): remove hacky "do it twice
+ in case the first one failed," since the test suite is less
+ broken now.
+
2003-04-10 Havoc Pennington <hp@pobox.com>
* bus/dispatch.c (check_segfault_service_activation): add test
@@ -9,7 +18,7 @@
2003-04-10 Havoc Pennington <hp@pobox.com>
* dbus/dbus-spawn.c (_dbus_spawn_async_with_babysitter): move all
- the possible parent failures before we fork, so that we don't q
+ the possible parent failures before we fork, so that we don't
fail to create a babysitter after creating the child.
* bus/activation.c (bus_activation_activate_service): kill child
diff --git a/bus/dispatch.c b/bus/dispatch.c
index 29364665..41317549 100644
--- a/bus/dispatch.c
+++ b/bus/dispatch.c
@@ -1445,11 +1445,15 @@ check_send_exit_to_service (BusContext *context,
static dbus_bool_t
check_got_error (BusContext *context,
DBusConnection *connection,
- const char *error_name)
+ const char *first_error_name,
+ ...)
{
DBusMessage *message;
dbus_bool_t retval;
-
+ va_list ap;
+ dbus_bool_t error_found;
+ const char *error_name;
+
retval = FALSE;
message = pop_message_waiting_for_memory (connection);
@@ -1466,10 +1470,25 @@ check_got_error (BusContext *context,
goto out;
}
- if (!dbus_message_name_is (message, error_name))
+ error_found = FALSE;
+
+ va_start (ap, first_error_name);
+ error_name = first_error_name;
+ while (error_name != NULL)
+ {
+ if (dbus_message_name_is (message, error_name))
+ {
+ error_found = TRUE;
+ break;
+ }
+ error_name = va_arg (ap, char*);
+ }
+ va_end (ap);
+
+ if (!error_found)
{
- _dbus_warn ("Expected error %s, got %s instead\n",
- error_name,
+ _dbus_warn ("Expected error %s or other, got %s instead\n",
+ first_error_name,
dbus_message_get_name (message));
goto out;
}
@@ -1613,7 +1632,9 @@ check_existent_service_activation (BusContext *context,
if (got_error)
{
if (!check_got_error (context, connection,
- DBUS_ERROR_SPAWN_CHILD_EXITED))
+ DBUS_ERROR_SPAWN_CHILD_EXITED,
+ DBUS_ERROR_NO_MEMORY,
+ NULL))
goto out;
/* A service deleted should be coming along now after this error.
@@ -1648,7 +1669,8 @@ check_existent_service_activation (BusContext *context,
bus_test_run_everything (context);
if (!check_got_error (context, connection,
- DBUS_ERROR_SPAWN_CHILD_EXITED))
+ DBUS_ERROR_SPAWN_CHILD_EXITED,
+ NULL))
goto out;
}
}
diff --git a/bus/test.c b/bus/test.c
index c4d999f9..db3065b9 100644
--- a/bus/test.c
+++ b/bus/test.c
@@ -335,16 +335,9 @@ bus_test_run_bus_loop (BusContext *context,
void
bus_test_run_everything (BusContext *context)
{
- int i;
-
- i = 0;
- while (i < 2)
- {
- while (_dbus_loop_iterate (bus_context_get_loop (context), FALSE) ||
- (client_loop == NULL || _dbus_loop_iterate (client_loop, FALSE)))
- ;
- ++i;
- }
+ while (_dbus_loop_iterate (bus_context_get_loop (context), FALSE) ||
+ (client_loop == NULL || _dbus_loop_iterate (client_loop, FALSE)))
+ ;
}
BusContext*