diff options
author | Havoc Pennington <hp@redhat.com> | 2003-04-10 05:12:19 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-04-10 05:12:19 +0000 |
commit | 51781f541094a4936d47119cd62682e0431c41e9 (patch) | |
tree | d551d4ed8147fd12a73a86ea3febd95608fff491 /dbus/dbus-internals.c | |
parent | 49f6e320d790e168ccec040ad47b787c32107bde (diff) |
2003-04-10 Havoc Pennington <hp@pobox.com>
* bus/dispatch.c: lots of fixes
* dbus/dbus-mainloop.c (_dbus_loop_dispatch): export
(_dbus_loop_iterate): remove old "quit if no callbacks" code,
that was crack, broke the test service.
* dbus/dbus-transport.c (_dbus_transport_open): fix error
handling to avoid piling up errors if we get a failure on the
first address.
* dbus/dbus-internals.c (_dbus_real_assert_not_reached): include
pid in assertion failures.
* dbus/dbus-mainloop.c (_dbus_loop_iterate): use static arrays up
to some fixed size of file descriptor array. Don't return TRUE
anytime a timeout exists, that led to lots of busy loop silliness
in the tests.
Diffstat (limited to 'dbus/dbus-internals.c')
-rw-r--r-- | dbus/dbus-internals.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index 6a662e5d..230c8efe 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -363,8 +363,8 @@ _dbus_real_assert (dbus_bool_t condition, { if (!condition) { - _dbus_warn ("Assertion failed \"%s\" file \"%s\" line %d\n", - condition_text, file, line); + _dbus_warn ("Assertion failed \"%s\" file \"%s\" line %d process %lu\n", + condition_text, file, line, _dbus_getpid ()); _dbus_abort (); } } @@ -384,8 +384,8 @@ _dbus_real_assert_not_reached (const char *explanation, const char *file, int line) { - _dbus_warn ("File \"%s\" line %d should not have been reached: %s\n", - file, line, explanation); + _dbus_warn ("File \"%s\" line %d process %lu should not have been reached: %s\n", + file, line, _dbus_getpid (), explanation); _dbus_abort (); } #endif /* DBUS_DISABLE_ASSERT */ @@ -442,12 +442,14 @@ _dbus_test_oom_handling (const char *description, _dbus_set_fail_alloc_counter (_DBUS_INT_MAX); + _dbus_verbose ("Running once to count mallocs\n"); + if (!(* func) (data)) return FALSE; approx_mallocs = _DBUS_INT_MAX - _dbus_get_fail_alloc_counter (); - _dbus_verbose ("=================\n%s: about %d mallocs total\n=================\n", + _dbus_verbose ("\n=================\n%s: about %d mallocs total\n=================\n", description, approx_mallocs); _dbus_set_fail_alloc_failures (1); @@ -466,7 +468,7 @@ _dbus_test_oom_handling (const char *description, if (!run_failing_each_malloc (approx_mallocs, description, func, data)) return FALSE; - _dbus_verbose ("=================\n%s: all iterations passed\n=================\n", + _dbus_verbose ("\n=================\n%s: all iterations passed\n=================\n", description); return TRUE; |