|| (d->expected_kind == OWNER_CHANGED && (!old_owner[0] || !new_owner[0]))
|| (d->expected_kind == SERVICE_DELETED && (!old_owner[0] || new_owner[0])))
{
- _dbus_warn ("inconsistent NameOwnerChanged arguments");
+ _dbus_warn ("inconsistent NameOwnerChanged arguments\n");
goto out;
}
}
else
{
- _dbus_warn ("unexpected arguments for NameOwnerChanged message");
+ _dbus_warn ("unexpected arguments for NameOwnerChanged message\n");
message_kind = GOT_SOMETHING_ELSE;
}
}
if (message_kind != GOT_ERROR)
{
block_connection_until_message_from_bus (context, connection, "error about service exiting");
-
+
/* and process everything again */
bus_test_run_everything (context);
if (!check_got_error (context, connection,
DBUS_ERROR_SPAWN_CHILD_EXITED,
+ DBUS_ERROR_NO_MEMORY,
NULL))
goto out;
}
if (message == NULL)
{
_dbus_warn ("No message after auto activation "
- "(should be a service announcement)");
+ "(should be a service announcement)\n");
dbus_connection_return_message (connection, message);
message = NULL;
goto out;
if (message == NULL)
{
_dbus_warn ("No message after auto activation "
- "(should be a service announcement)");
+ "(should be a service announcement)\n");
dbus_connection_return_message (connection, message);
message = NULL;
goto out;
DBUS_TYPE_STRING, &argv[6],
DBUS_TYPE_INVALID))
{
- _dbus_warn ("Error getting arguments from return");
+ _dbus_warn ("Error getting arguments from return\n");
goto out;
}
*/
if (strcmp("-test", argv[1]) != 0)
{
- _dbus_warn ("Unexpected argv[1] in shell success service test (expected: %s, got: %s)",
+ _dbus_warn ("Unexpected argv[1] in shell success service test (expected: %s, got: %s)\n",
"-test", argv[1]);
goto out;
}
if (strcmp("that", argv[2]) != 0)
{
- _dbus_warn ("Unexpected argv[2] in shell success service test (expected: %s, got: %s)",
+ _dbus_warn ("Unexpected argv[2] in shell success service test (expected: %s, got: %s)\n",
"that", argv[2]);
goto out;
}
if (strcmp("we get", argv[3]) != 0)
{
- _dbus_warn ("Unexpected argv[3] in shell success service test (expected: %s, got: %s)",
+ _dbus_warn ("Unexpected argv[3] in shell success service test (expected: %s, got: %s)\n",
"we get", argv[3]);
goto out;
}
if (strcmp("back", argv[4]) != 0)
{
- _dbus_warn ("Unexpected argv[4] in shell success service test (expected: %s, got: %s)",
+ _dbus_warn ("Unexpected argv[4] in shell success service test (expected: %s, got: %s)\n",
"back", argv[4]);
goto out;
}
if (strcmp("--what", argv[5]) != 0)
{
- _dbus_warn ("Unexpected argv[5] in shell success service test (expected: %s, got: %s)",
+ _dbus_warn ("Unexpected argv[5] in shell success service test (expected: %s, got: %s)\n",
"--what", argv[5]);
goto out;
}
if (strcmp("we put in", argv[6]) != 0)
{
- _dbus_warn ("Unexpected argv[6] in shell success service test (expected: %s, got: %s)",
+ _dbus_warn ("Unexpected argv[6] in shell success service test (expected: %s, got: %s)\n",
"we put in", argv[6]);
goto out;
}
case GOT_ERROR:
case GOT_SERVICE_DELETED:
_dbus_warn ("Unexpected message after ActivateService "
- "(should be an error or a service announcement");
+ "(should be an error or a service announcement)\n");
goto out;
case GOT_SERVICE_CREATED:
if (!check_no_leftovers (d->context))
{
- _dbus_warn ("Messages were left over, should be covered by test suite");
+ _dbus_warn ("Messages were left over, should be covered by test suite\n");
return FALSE;
}
if (!check_no_leftovers (context))
{
- _dbus_warn ("Messages were left over after setting up initial connections");
+ _dbus_warn ("Messages were left over after setting up initial connections\n");
_dbus_assert_not_reached ("initial connection setup failed");
}
static dbus_bool_t guards = FALSE;
static dbus_bool_t disable_mem_pools = FALSE;
static dbus_bool_t backtrace_on_fail_alloc = FALSE;
-static int n_blocks_outstanding = 0;
+static DBusAtomic n_blocks_outstanding = {0};
/** value stored in guard padding for debugging buffer overrun */
#define GUARD_VALUE 0xdeadbeef
int
_dbus_get_malloc_blocks_outstanding (void)
{
- return n_blocks_outstanding;
+ return n_blocks_outstanding.value;
}
/**
if (_dbus_decrement_fail_alloc_counter ())
{
_dbus_verbose (" FAILING malloc of %ld bytes\n", (long) bytes);
-
return NULL;
}
#endif
-
+
if (bytes == 0) /* some system mallocs handle this, some don't */
return NULL;
#ifdef DBUS_BUILD_TESTS
block = malloc (bytes + GUARD_EXTRA_SIZE);
if (block)
- n_blocks_outstanding += 1;
+ _dbus_atomic_inc (&n_blocks_outstanding);
return set_guards (block, bytes, SOURCE_MALLOC);
}
mem = malloc (bytes);
#ifdef DBUS_BUILD_TESTS
if (mem)
- n_blocks_outstanding += 1;
+ _dbus_atomic_inc (&n_blocks_outstanding);
#endif
return mem;
}
return NULL;
}
#endif
-
+
if (bytes == 0)
return NULL;
#ifdef DBUS_BUILD_TESTS
block = calloc (bytes + GUARD_EXTRA_SIZE, 1);
if (block)
- n_blocks_outstanding += 1;
+ _dbus_atomic_inc (&n_blocks_outstanding);
return set_guards (block, bytes, SOURCE_MALLOC_ZERO);
}
#endif
mem = calloc (bytes, 1);
#ifdef DBUS_BUILD_TESTS
if (mem)
- n_blocks_outstanding += 1;
+ _dbus_atomic_inc (&n_blocks_outstanding);
#endif
return mem;
}
block = malloc (bytes + GUARD_EXTRA_SIZE);
if (block)
- n_blocks_outstanding += 1;
+ _dbus_atomic_inc (&n_blocks_outstanding);
return set_guards (block, bytes, SOURCE_REALLOC_NULL);
}
mem = realloc (memory, bytes);
#ifdef DBUS_BUILD_TESTS
if (memory == NULL && mem != NULL)
- n_blocks_outstanding += 1;
+ _dbus_atomic_inc (&n_blocks_outstanding);
#endif
return mem;
}
check_guards (memory, TRUE);
if (memory)
{
- n_blocks_outstanding -= 1;
+ _dbus_atomic_dec (&n_blocks_outstanding);
- _dbus_assert (n_blocks_outstanding >= 0);
+ _dbus_assert (n_blocks_outstanding.value >= 0);
free (((unsigned char*)memory) - GUARD_START_OFFSET);
}
if (memory) /* we guarantee it's safe to free (NULL) */
{
#ifdef DBUS_BUILD_TESTS
- n_blocks_outstanding -= 1;
+ _dbus_atomic_dec (&n_blocks_outstanding);
- _dbus_assert (n_blocks_outstanding >= 0);
+ _dbus_assert (n_blocks_outstanding.value >= 0);
#endif
free (memory);