Commit a2129f7c authored by Havoc Pennington's avatar Havoc Pennington

2006-10-01 Havoc Pennington <hp@redhat.com>

	* dbus/dbus-connection.c (_dbus_connection_close_if_only_one_ref):
	Add a hack to make DBusNewConnectionFunction work right.

	* dbus/dbus-server-socket.c (handle_new_client_fd_and_unlock): use
	the hack here. Also, fix the todo about refcount leak.

	* dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
	and use the hack here

        * dbus/dbus-connection.c: Kill the "shared" flag vs. the
	"shareable" flag; this was completely broken, since it meant
	dbus_connection_open() returned a connection of unknown
	shared-ness. Now, we always hold a ref on anything opened
	as shareable.

	Move the call to notify dbus-bus.c into
	connection_forget_shared_unlocked, so libdbus consistently forgets
	all its knowledge of a connection at once. This exposed numerous
	places where things were totally broken if we dropped a ref inside
	get_dispatch_status_unlocked where
	connection_forget_shared_unlocked was previously, so move
	connection_forget_shared_unlocked into
	_dbus_connection_update_dispatch_status_and_unlock. Also move the
	exit_on_disconnect here.

	(shared_connections_shutdown): this assumed weak refs to the
	shared connections; since we have strong refs now, the assertion
	was failing and stuff was left in the hash. Fix it to close
	still-open shared connections.

	* bus/dispatch.c: fixup to use dbus_connection_open_private on the
	debug pipe connections

	* dbus/dbus-connection.c (dbus_connection_dispatch): only notify
	dbus-bus.c if the closed connection is in fact shared
	(_dbus_connection_close_possibly_shared): rename from
	_dbus_connection_close_internal
	(dbus_connection_close, dbus_connection_open,
	dbus_connection_open_private): Improve docs to explain the deal
	with when you should close or unref or both

	* dbus/dbus-bus.c
	(_dbus_bus_notify_shared_connection_disconnected_unlocked): rename
	from _dbus_bus_check_connection_and_unref_unlocked and modify to
	loop over all connections

	* test/test-utils.c (test_connection_shutdown): don't try to close
	shared connections.

	* test/name-test/test-threads-init.c (main): fix warnings in here

	* dbus/dbus-sysdeps.c (_dbus_abort): support DBUS_BLOCK_ON_ABORT
	env variable to cause blocking waiting for gdb; drop
	DBUS_PRINT_BACKTRACE and just call _dbus_print_backtrace()
	unconditionally.

	* configure.in: add -export-dynamic to libtool flags if assertions enabled
	so _dbus_print_backtrace works.

	* dbus/dbus-sysdeps-unix.c (_dbus_print_backtrace): use fprintf
	instead of _dbus_verbose to print the backtrace, and diagnose lack
	of -rdynamic/-export-dynamic
parent eef10bc3
2006-10-01 Havoc Pennington <hp@redhat.com>
* dbus/dbus-connection.c (_dbus_connection_close_if_only_one_ref):
Add a hack to make DBusNewConnectionFunction work right.
* dbus/dbus-server-socket.c (handle_new_client_fd_and_unlock): use
the hack here. Also, fix the todo about refcount leak.
* dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
and use the hack here
* dbus/dbus-connection.c: Kill the "shared" flag vs. the
"shareable" flag; this was completely broken, since it meant
dbus_connection_open() returned a connection of unknown
shared-ness. Now, we always hold a ref on anything opened
as shareable.
Move the call to notify dbus-bus.c into
connection_forget_shared_unlocked, so libdbus consistently forgets
all its knowledge of a connection at once. This exposed numerous
places where things were totally broken if we dropped a ref inside
get_dispatch_status_unlocked where
connection_forget_shared_unlocked was previously, so move
connection_forget_shared_unlocked into
_dbus_connection_update_dispatch_status_and_unlock. Also move the
exit_on_disconnect here.
(shared_connections_shutdown): this assumed weak refs to the
shared connections; since we have strong refs now, the assertion
was failing and stuff was left in the hash. Fix it to close
still-open shared connections.
* bus/dispatch.c: fixup to use dbus_connection_open_private on the
debug pipe connections
* dbus/dbus-connection.c (dbus_connection_dispatch): only notify
dbus-bus.c if the closed connection is in fact shared
(_dbus_connection_close_possibly_shared): rename from
_dbus_connection_close_internal
(dbus_connection_close, dbus_connection_open,
dbus_connection_open_private): Improve docs to explain the deal
with when you should close or unref or both
* dbus/dbus-bus.c
(_dbus_bus_notify_shared_connection_disconnected_unlocked): rename
from _dbus_bus_check_connection_and_unref_unlocked and modify to
loop over all connections
* test/test-utils.c (test_connection_shutdown): don't try to close
shared connections.
* test/name-test/test-threads-init.c (main): fix warnings in here
* dbus/dbus-sysdeps.c (_dbus_abort): support DBUS_BLOCK_ON_ABORT
env variable to cause blocking waiting for gdb; drop
DBUS_PRINT_BACKTRACE and just call _dbus_print_backtrace()
unconditionally.
* configure.in: add -export-dynamic to libtool flags if assertions enabled
so _dbus_print_backtrace works.
* dbus/dbus-sysdeps-unix.c (_dbus_print_backtrace): use fprintf
instead of _dbus_verbose to print the backtrace, and diagnose lack
of -rdynamic/-export-dynamic
2006-09-30 Havoc Pennington <hp@redhat.com>
* dbus/dbus-bus.c (dbus_bus_get_private, dbus_bus_get)
......
......@@ -75,12 +75,14 @@ dbus_daemon_LDADD= \
$(DBUS_BUS_LIBS) \
$(top_builddir)/dbus/libdbus-convenience.la
dbus_daemon_LDFLAGS=@R_DYNAMIC_LDFLAG@
## note that TESTS has special meaning (stuff to use in make check)
## so if adding tests not to be run in make check, don't add them to
## TESTS
if DBUS_BUILD_TESTS
TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_builddir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus
TESTS=bus-test
TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_builddir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus DBUS_FATAL_WARNINGS=1 DBUS_BLOCK_ON_ABORT=1
TESTS=bus-test
else
TESTS=
endif
......@@ -94,6 +96,7 @@ bus_test_SOURCES= \
test-main.c
bus_test_LDADD=$(top_builddir)/dbus/libdbus-convenience.la $(DBUS_BUS_LIBS)
bus_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
## mop up the gcov files
clean-local:
......@@ -104,9 +107,9 @@ uninstall-hook:
install-data-hook:
if test '!' -d $(DESTDIR)$(DBUS_DAEMONDIR); then \
$(mkinstalldirs) $(DESTDIR)$(DBUS_DAEMONDIR); \
chmod 755 $(DESTDIR)$(DBUS_DAEMONDIR); \
fi
$(mkinstalldirs) $(DESTDIR)$(DBUS_DAEMONDIR); \
chmod 755 $(DESTDIR)$(DBUS_DAEMONDIR); \
fi
$(INSTALL_PROGRAM) dbus-daemon $(DESTDIR)$(DBUS_DAEMONDIR)
$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
$(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
......
......@@ -1479,7 +1479,7 @@ check_hello_connection (BusContext *context)
dbus_error_init (&error);
connection = dbus_connection_open ("debug-pipe:name=test-server", &error);
connection = dbus_connection_open_private ("debug-pipe:name=test-server", &error);
if (connection == NULL)
{
_DBUS_ASSERT_ERROR_IS_SET (&error);
......@@ -3998,7 +3998,7 @@ bus_dispatch_test (const DBusString *test_data_dir)
if (context == NULL)
return FALSE;
foo = dbus_connection_open ("debug-pipe:name=test-server", &error);
foo = dbus_connection_open_private ("debug-pipe:name=test-server", &error);
if (foo == NULL)
_dbus_assert_not_reached ("could not alloc connection");
......@@ -4016,7 +4016,7 @@ bus_dispatch_test (const DBusString *test_data_dir)
if (!check_add_match_all (context, foo))
_dbus_assert_not_reached ("AddMatch message failed");
bar = dbus_connection_open ("debug-pipe:name=test-server", &error);
bar = dbus_connection_open_private ("debug-pipe:name=test-server", &error);
if (bar == NULL)
_dbus_assert_not_reached ("could not alloc connection");
......@@ -4031,7 +4031,7 @@ bus_dispatch_test (const DBusString *test_data_dir)
if (!check_add_match_all (context, bar))
_dbus_assert_not_reached ("AddMatch message failed");
baz = dbus_connection_open ("debug-pipe:name=test-server", &error);
baz = dbus_connection_open_private ("debug-pipe:name=test-server", &error);
if (baz == NULL)
_dbus_assert_not_reached ("could not alloc connection");
......@@ -4125,7 +4125,7 @@ bus_dispatch_sha1_test (const DBusString *test_data_dir)
if (context == NULL)
return FALSE;
foo = dbus_connection_open ("debug-pipe:name=test-server", &error);
foo = dbus_connection_open_private ("debug-pipe:name=test-server", &error);
if (foo == NULL)
_dbus_assert_not_reached ("could not alloc connection");
......
......@@ -82,10 +82,24 @@ fi
if test x$enable_verbose_mode = xyes; then
AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
fi
if test x$enable_asserts = xno; then
AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
AC_DEFINE(G_DISABLE_ASSERT,1,[Disable GLib assertion macros])
R_DYNAMIC_LDFLAG=""
else
# -rdynamic is needed for glibc's backtrace_symbols to work.
# No clue how much overhead this adds, but it's useful
# to do this on any assertion failure,
# so for now it's enabled anytime asserts are (currently not
# in production builds).
# To get -rdynamic you pass -export-dynamic to libtool.
AC_DEFINE(DBUS_BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
R_DYNAMIC_LDFLAG=-export-dynamic
fi
AC_SUBST(R_DYNAMIC_LDFLAG)
if test x$enable_checks = xno; then
AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
......
......@@ -164,7 +164,9 @@ noinst_LTLIBRARIES=libdbus-convenience.la
libdbus_1_la_LIBADD= $(DBUS_CLIENT_LIBS)
## don't export symbols that start with "_" (we use this
## convention for internal symbols)
libdbus_1_la_LDFLAGS= -export-symbols-regex "^[^_].*" -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -no-undefined
libdbus_1_la_LDFLAGS= -export-symbols-regex "^[^_].*" -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -no-undefined @R_DYNAMIC_LDFLAG@
libdbus_convenience_la_LDFLAGS=@R_DYNAMIC_LDFLAG@
## note that TESTS has special meaning (stuff to use in make check)
## so if adding tests not to be run in make check, don't add them to
......@@ -184,6 +186,7 @@ dbus_test_SOURCES= \
dbus-test-main.c
dbus_test_LDADD=libdbus-convenience.la
dbus_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
## mop up the gcov files
clean-local:
......
......@@ -158,6 +158,7 @@ init_connections_unlocked (void)
/* Use default system bus address if none set in environment */
bus_connection_addresses[DBUS_BUS_SYSTEM] =
_dbus_strdup (DBUS_SYSTEM_BUS_DEFAULT_ADDRESS);
if (bus_connection_addresses[DBUS_BUS_SYSTEM] == NULL)
return FALSE;
......@@ -179,7 +180,8 @@ init_connections_unlocked (void)
if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
bus_connection_addresses[DBUS_BUS_SESSION] =
_dbus_strdup (DBUS_SESSION_BUS_DEFAULT_ADDRESS);
if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
if (bus_connection_addresses[DBUS_BUS_SESSION] == NULL)
return FALSE;
_dbus_verbose (" \"%s\"\n", bus_connection_addresses[DBUS_BUS_SESSION] ?
......@@ -310,27 +312,32 @@ ensure_bus_data (DBusConnection *connection)
return bd;
}
/* internal function that checks to see if this
is a shared connection owned by the bus and if it is unref it */
/**
* Internal function that checks to see if this
* is a shared connection owned by the bus and if it is unref it.
*
* @param connection a connection that has been disconnected.
*/
void
_dbus_bus_check_connection_and_unref_unlocked (DBusConnection *connection)
_dbus_bus_notify_shared_connection_disconnected_unlocked (DBusConnection *connection)
{
int i;
_DBUS_LOCK (bus);
if (bus_connections[DBUS_BUS_SYSTEM] == connection)
{
bus_connections[DBUS_BUS_SYSTEM] = NULL;
_dbus_connection_unref_unlocked (connection);
}
else if (bus_connections[DBUS_BUS_SESSION] == connection)
{
bus_connections[DBUS_BUS_SESSION] = NULL;
_dbus_connection_unref_unlocked (connection);
}
else if (bus_connections[DBUS_BUS_STARTER] == connection)
/* We are expecting to have the connection saved in only one of these
* slots, but someone could in a pathological case set system and session
* bus to the same bus or something. Or set one of them to the starter
* bus without setting the starter bus type in the env variable.
* So we don't break the loop as soon as we find a match.
*/
for (i = 0; i < N_BUS_TYPES; ++i)
{
bus_connections[DBUS_BUS_STARTER] = NULL;
_dbus_connection_unref_unlocked (connection);
if (bus_connections[i] == connection)
{
bus_connections[i] = NULL;
_dbus_connection_unref_unlocked (connection);
}
}
_DBUS_UNLOCK (bus);
......@@ -392,7 +399,7 @@ internal_bus_get (DBusBusType type,
}
if (private)
connection = dbus_connection_open_private(address, error);
connection = dbus_connection_open_private (address, error);
else
connection = dbus_connection_open (address, error);
......@@ -412,7 +419,7 @@ internal_bus_get (DBusBusType type,
if (!dbus_bus_register (connection, error))
{
_DBUS_ASSERT_ERROR_IS_SET (error);
_dbus_connection_close_internal (connection);
_dbus_connection_close_possibly_shared (connection);
dbus_connection_unref (connection);
_DBUS_UNLOCK (bus);
......@@ -432,6 +439,8 @@ internal_bus_get (DBusBusType type,
bd->is_well_known = TRUE;
_DBUS_UNLOCK (bus);
/* Return a reference to the caller */
return connection;
}
......@@ -446,11 +455,22 @@ internal_bus_get (DBusBusType type,
/**
* Connects to a bus daemon and registers the client with it. If a
* connection to the bus already exists, then that connection is
* returned. Caller owns a reference to the bus.
* returned. The caller of this function owns a reference to the bus.
*
* The caller may NOT call dbus_connection_close() on this connection;
* see dbus_connection_open() and dbus_connection_close() for details
* on that.
*
* If this function obtains a new connection object never before
* returned from dbus_bus_get(), it will call
* dbus_connection_set_exit_on_disconnect(), so the application
* will exit if the connection closes. You can undo this
* by calling dbus_connection_set_exit_on_disconnect() yourself
* after you get the connection.
*
* @param type bus type
* @param error address where an error can be returned.
* @returns a DBusConnection with new ref
* @returns a #DBusConnection with new ref
*/
DBusConnection *
dbus_bus_get (DBusBusType type,
......@@ -460,10 +480,20 @@ dbus_bus_get (DBusBusType type,
}
/**
* Connects to a bus daemon and registers the client with it. Unlike
* dbus_bus_get(), always creates a new connection. This connection
* Connects to a bus daemon and registers the client with it as with dbus_bus_register().
* Unlike dbus_bus_get(), always creates a new connection. This connection
* will not be saved or recycled by libdbus. Caller owns a reference
* to the bus.
* to the bus and must either close it or know it to be closed
* prior to releasing this reference.
*
* See dbus_connection_open_private() for more details on when to
* close and unref this connection.
*
* This function calls
* dbus_connection_set_exit_on_disconnect() on the new connection, so the application
* will exit if the connection closes. You can undo this
* by calling dbus_connection_set_exit_on_disconnect() yourself
* after you get the connection.
*
* @param type bus type
* @param error address where an error can be returned.
......@@ -481,6 +511,9 @@ dbus_bus_get_private (DBusBusType type,
* thing an application does when connecting to the message bus.
* If registration succeeds, the unique name will be set,
* and can be obtained using dbus_bus_get_unique_name().
*
* If you use dbus_bus_get() or dbus_bus_get_private() this
* function will be called for you.
*
* @param connection the connection
* @param error place to store errors
......
......@@ -68,7 +68,7 @@ void dbus_bus_remove_match (DBusConnection *connection,
const char *rule,
DBusError *error);
void _dbus_bus_check_connection_and_unref_unlocked (DBusConnection *connection);
void _dbus_bus_notify_shared_connection_disconnected_unlocked (DBusConnection *connection);
DBUS_END_DECLS
......
......@@ -77,7 +77,8 @@ DBusConnection* _dbus_connection_new_for_transport (DBusTransport
void _dbus_connection_do_iteration_unlocked (DBusConnection *connection,
unsigned int flags,
int timeout_milliseconds);
void _dbus_connection_close_internal (DBusConnection *connection);
void _dbus_connection_close_possibly_shared (DBusConnection *connection);
void _dbus_connection_close_if_only_one_ref (DBusConnection *connection);
DBusPendingCall* _dbus_pending_call_new (DBusConnection *connection,
int timeout_milliseconds,
......
This diff is collapsed.
......@@ -190,6 +190,9 @@
*/
const char _dbus_no_memory_message[] = "Not enough memory";
static dbus_bool_t warn_initted = FALSE;
static dbus_bool_t fatal_warnings = FALSE;
/**
* Prints a warning message to stderr.
*
......@@ -199,12 +202,27 @@ void
_dbus_warn (const char *format,
...)
{
/* FIXME not portable enough? */
va_list args;
if (!warn_initted)
{
const char *s;
s = _dbus_getenv ("DBUS_FATAL_WARNINGS");
if (s && *s)
fatal_warnings = TRUE;
warn_initted = TRUE;
}
va_start (args, format);
vfprintf (stderr, format, args);
va_end (args);
if (fatal_warnings)
{
fflush (stderr);
_dbus_abort ();
}
}
#ifdef DBUS_ENABLE_VERBOSE_MODE
......
......@@ -317,6 +317,7 @@ _dbus_transport_debug_pipe_new (const char *server_name,
/* If no one grabbed a reference, the connection will die,
* and the client transport will get an immediate disconnect
*/
_dbus_connection_close_if_only_one_ref (connection);
dbus_connection_unref (connection);
return client_transport;
......
......@@ -69,14 +69,6 @@ socket_finalize (DBusServer *server)
dbus_free (server);
}
/**
* @todo unreffing the connection at the end may cause
* us to drop the last ref to the connection before
* disconnecting it. That is invalid.
*
* @todo doesn't this leak a server refcount if
* new_connection_function is NULL?
*/
/* Return value is just for memory, not other failures. */
static dbus_bool_t
handle_new_client_fd_and_unlock (DBusServer *server,
......@@ -140,10 +132,11 @@ handle_new_client_fd_and_unlock (DBusServer *server,
{
(* new_connection_function) (server, connection,
new_connection_data);
dbus_server_unref (server);
}
dbus_server_unref (server);
/* If no one grabbed a reference, the connection will die. */
_dbus_connection_close_if_only_one_ref (connection);
dbus_connection_unref (connection);
return TRUE;
......
......@@ -791,7 +791,15 @@ dbus_server_get_address (DBusServer *server)
* function is passed each new connection as the connection is
* created. If the new connection function increments the connection's
* reference count, the connection will stay alive. Otherwise, the
* connection will be unreferenced and closed.
* connection will be unreferenced and closed. The new connection
* function may also close the connection itself, which is considered
* good form if the connection is not wanted.
*
* The connection here is private in the sense of
* dbus_connection_open_private(), so if the new connection function
* keeps a reference it must arrange for the connection to be closed.
* i.e. libdbus does not own this connection once the new connection
* function takes a reference.
*
* @param server the server.
* @param function a function to handle new connections.
......
......@@ -2129,14 +2129,14 @@ _dbus_set_fd_nonblocking (int fd,
#if !defined (DBUS_DISABLE_ASSERT) || defined(DBUS_BUILD_TESTS)
/**
* On GNU libc systems, print a crude backtrace to the verbose log.
* On other systems, print "no backtrace support"
*
* On GNU libc systems, print a crude backtrace to stderr. On other
* systems, print "no backtrace support" and block for possible gdb
* attachment if an appropriate environment variable is set.
*/
void
_dbus_print_backtrace (void)
{
#if defined (HAVE_BACKTRACE) && defined (DBUS_ENABLE_VERBOSE_MODE)
{
#if defined (HAVE_BACKTRACE) && defined (DBUS_BUILT_R_DYNAMIC)
void *bt[500];
int bt_size;
int i;
......@@ -2149,13 +2149,17 @@ _dbus_print_backtrace (void)
i = 0;
while (i < bt_size)
{
_dbus_verbose (" %s\n", syms[i]);
/* don't use dbus_warn since it can _dbus_abort() */
fprintf (stderr, " %s\n", syms[i]);
++i;
}
fflush (stderr);
free (syms);
#elif defined (HAVE_BACKTRACE) && ! defined (DBUS_BUILT_R_DYNAMIC)
fprintf (stderr, " D-Bus not built with -rdynamic so unable to print a backtrace\n");
#else
_dbus_verbose (" D-Bus not compiled with backtrace support\n");
fprintf (stderr, " D-Bus not compiled with backtrace support so unable to print a backtrace\n");
#endif
}
#endif /* asserts or tests enabled */
......
......@@ -60,14 +60,20 @@ _DBUS_DEFINE_GLOBAL_LOCK (sid_atom_cache);
void
_dbus_abort (void)
{
#ifdef DBUS_ENABLE_VERBOSE_MODE
const char *s;
s = _dbus_getenv ("DBUS_PRINT_BACKTRACE");
_dbus_print_backtrace ();
s = _dbus_getenv ("DBUS_BLOCK_ON_ABORT");
if (s && *s)
_dbus_print_backtrace ();
#endif
{
/* don't use _dbus_warn here since it can _dbus_abort() */
fprintf (stderr, " Process %lu sleeping for gdb attach\n", (unsigned long) _dbus_getpid());
_dbus_sleep_milliseconds (1000 * 60);
}
abort ();
_dbus_exit (1); /* in case someone manages to ignore SIGABRT */
_dbus_exit (1); /* in case someone manages to ignore SIGABRT ? */
}
#endif
......
......@@ -47,6 +47,11 @@ Might as Well for 1.0
Can Be Post 1.0
===
- _dbus_connection_unref_unlocked() is essentially always broken because
the connection finalizer calls non-unlocked functions. One fix is to make
the finalizer run with the lock held, but since it calls out to the app that may
be pretty broken. More likely all the uses of unref_unlocked are just wrong.
- if the GUID is obtained only during authentication, not in the address,
we could still share the connection
......@@ -132,4 +137,8 @@ Should Be Post 1.0
===
- look into supporting the concept of a "connection" generically
(what does this TODO item mean?)
- test/name-test should be named test/with-bus or something like that
......@@ -62,12 +62,19 @@ decode_gcov_SOURCES= \
TEST_LIBS=$(DBUS_TEST_LIBS) $(top_builddir)/dbus/libdbus-convenience.la
test_service_LDADD=$(TEST_LIBS)
test_service_LDFLAGS=@R_DYNAMIC_LDFLAG@
test_names_LDADD=$(TEST_LIBS)
test_names_LDFLAGS=@R_DYNAMIC_LDFLAG@
## break_loader_LDADD= $(TEST_LIBS)
## break_loader_LDFLAGS=@R_DYNAMIC_LDFLAG@
test_shell_service_LDADD=$(TEST_LIBS)
test_shell_service_LDFLAGS=@R_DYNAMIC_LDFLAG@
shell_test_LDADD=$(TEST_LIBS)
shell_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
spawn_test_LDADD=$(TEST_LIBS)
spawn_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
decode_gcov_LDADD=$(TEST_LIBS)
decode_gcov_LDFLAGS=@R_DYNAMIC_LDFLAG@
EXTRA_DIST=
......
......@@ -22,17 +22,19 @@ test_names_SOURCES= \
test-names.c
test_names_LDADD=$(top_builddir)/dbus/libdbus-1.la $(top_builddir)/dbus/libdbus-convenience.la
test_names_LDFLAGS=@R_DYNAMIC_LDFLAG@
test_pending_call_dispatch_SOURCES = \
test-pending-call-dispatch.c
test_pending_call_dispatch_LDADD=$(top_builddir)/dbus/libdbus-1.la $(top_builddir)/dbus/libdbus-convenience.la
test_pending_call_dispatch_LDFLAGS=@R_DYNAMIC_LDFLAG@
test_threads_init_SOURCES = \
test-threads-init.c
test_threads_init_LDADD=$(top_builddir)/dbus/libdbus-1.la $(top_builddir)/dbus/libdbus-convenience.la
test_threads_init_LDFLAGS=@R_DYNAMIC_LDFLAG@
endif
/**
* Test to make sure late thread initialization works
**/
* Test to make sure late thread initialization works
*/
#include <dbus/dbus.h>
#include <dbus/dbus-sysdeps.h>
......@@ -8,6 +8,7 @@
#include <stdlib.h>
#include <dbus/dbus-internals.h>
#include <dbus/dbus-connection-internal.h>
static void
_run_iteration (DBusConnection *conn)
......@@ -107,9 +108,6 @@ check_condvar_lock (DBusCondVar *condvar1,
int
main (int argc, char *argv[])
{
long start_tv_sec, start_tv_usec;
long end_tv_sec, end_tv_usec;
int i;
DBusMessage *method;
DBusConnection *conn;
DBusError error;
......
......@@ -171,8 +171,6 @@ void
test_connection_shutdown (DBusLoop *loop,
DBusConnection *connection)
{
_dbus_connection_close_internal (connection);
if (!dbus_connection_set_watch_functions (connection,
NULL,
NULL,
......
......@@ -23,9 +23,16 @@ dbus_uuidgen_SOURCES= \
dbus-uuidgen.c
dbus_send_LDADD= $(top_builddir)/dbus/libdbus-1.la
dbus_send_LDFLAGS=@R_DYNAMIC_LDFLAG@
dbus_monitor_LDADD= $(top_builddir)/dbus/libdbus-1.la
dbus_monitor_LDFLAGS=@R_DYNAMIC_LDFLAG@
dbus_uuidgen_LDADD= $(top_builddir)/dbus/libdbus-1.la
dbus_uuidgen_LDFLAGS=@R_DYNAMIC_LDFLAG@
dbus_launch_LDADD= $(DBUS_X_LIBS)
dbus_launch_LDFLAGS=@R_DYNAMIC_LDFLAG@
man_MANS = dbus-send.1 dbus-monitor.1 dbus-launch.1 dbus-cleanup-sockets.1 dbus-uuidgen.1
EXTRA_DIST = $(man_MANS) run-with-tmp-session-bus.sh
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment