SF.net SVN: windbus: [559] trunk/DBus-win32.patch
Brought to you by:
syntheticpp
|
From: <syn...@us...> - 2007-02-11 14:40:17
|
Revision: 559
http://svn.sourceforge.net/windbus/?rev=559&view=rev
Author: syntheticpp
Date: 2007-02-11 06:40:13 -0800 (Sun, 11 Feb 2007)
Log Message:
-----------
remove patch for dbus-sysdeps-win.c
Modified Paths:
--------------
trunk/DBus-win32.patch
Modified: trunk/DBus-win32.patch
===================================================================
--- trunk/DBus-win32.patch 2007-02-11 14:34:27 UTC (rev 558)
+++ trunk/DBus-win32.patch 2007-02-11 14:40:13 UTC (rev 559)
@@ -1,6 +1,505 @@
+Index: test/spawn-test.c
+===================================================================
+--- test/spawn-test.c (revision 557)
++++ test/spawn-test.c (working copy)
+@@ -31,7 +31,7 @@
+ argv_copy [i] = argv[i + 1];
+ argv_copy[argc - 1] = NULL;
+
+- if (!_dbus_spawn_async_with_babysitter (NULL, argv_copy, setup_func, NULL, &error))
++ if (!_dbus_spawn_async_with_babysitter (NULL, argv_copy, NULL, setup_func, NULL, &error))
+ {
+ fprintf (stderr, "Could not launch application: \"%s\"\n",
+ error.message);
+Index: test/name-test/test-names.c
+===================================================================
+--- test/name-test/test-names.c (revision 557)
++++ test/name-test/test-names.c (working copy)
+@@ -1,9 +1,11 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <unistd.h>
+ #include <string.h>
+ #include <dbus/dbus.h>
+ #include <dbus/dbus-connection-internal.h>
++#ifdef HAVE_UNISTD_H
++#include <unistd.h>
++#endif
+
+ #define REMOVE_CONNECTION 0
+ #define ADD_CONNECTION 1
+Index: test/test-utils.c
+===================================================================
+--- test/test-utils.c (revision 557)
++++ test/test-utils.c (working copy)
+@@ -1,5 +1,7 @@
+ #include "test-utils.h"
+
++void _dbus_connection_close_internal (DBusConnection *connection);
++
+ typedef struct
+ {
+ DBusLoop *loop;
+Index: test/test-segfault.c
+===================================================================
+--- test/test-segfault.c (revision 557)
++++ test/test-segfault.c (working copy)
+@@ -1,10 +1,27 @@
+ /* This is simply a process that segfaults */
++#include <config.h>
+ #include <stdlib.h>
+ #include <signal.h>
+
++#ifdef DBUS_WIN
++#define RLIMIT_CORE 4 /* max core file size */
++typedef unsigned long rlim_t;
++struct rlimit {
++ rlim_t rlim_cur;
++ rlim_t rlim_max;
++};
++static int getrlimit (int __resource, struct rlimit *__rlp) {
++ return -1;
++}
++static int setrlimit (int __resource, const struct rlimit *__rlp) {
++ return -1;
++}
++#else
+ #include <sys/time.h>
+ #include <sys/resource.h>
++#endif
+
++
+ int
+ main (int argc, char **argv)
+ {
+Index: test/Makefile.am
+===================================================================
+--- test/Makefile.am (revision 557)
++++ test/Makefile.am (working copy)
+@@ -117,7 +117,7 @@
+ test -d $(top_builddir)/test/$$D || mkdir $(top_builddir)/test/$$D || exit 1 ; \
+ done ; \
+ if ! (test $(srcdir) = . || test $(srcdir) -ef .) ; then \
+- FILES=`(cd $(srcdir) && $(FIND_TESTS))` ; \
++ FILES=`(cd $(srcdir) && $(FIND_TESTS) | grep -Ev "(.svn|CVS)" )` ; \
+ for F in $$FILES; do \
+ SRC=$(srcdir)/$$F ; \
+ DEST=$(top_builddir)/test/$$F ; \
+Index: test/test-sleep-forever.c
+===================================================================
+--- test/test-sleep-forever.c (revision 557)
++++ test/test-sleep-forever.c (working copy)
+@@ -1,6 +1,12 @@
+ /* This is a process that just sleeps infinitely. */
+
++
++#include <config.h>
++#ifndef DBUS_WIN
+ #include <unistd.h>
++#else
++#include <stdlib.h>
++#endif
+
+ int
+ main (int argc, char **argv)
+Index: bus/config-loader-libxml.c
+===================================================================
+--- bus/config-loader-libxml.c (revision 557)
++++ bus/config-loader-libxml.c (working copy)
+@@ -134,6 +134,9 @@
+ }
+ }
+
++#ifdef DBUS_WIN
++ DBusString *_dbus_get_working_dir(void);
++#endif
+
+ BusConfigParser*
+ bus_config_load (const DBusString *file,
+@@ -147,7 +150,9 @@
+ DBusString dirname, data;
+ DBusError tmp_error;
+ int ret;
+-
++#ifdef DBUS_WIN
++ DBusString *dbusdir;
++#endif
+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
+
+ parser = NULL;
+@@ -177,13 +182,19 @@
+ xmlSetGenericErrorFunc (NULL, xml_shut_up);
+ }
+
+- if (!_dbus_string_get_dirname (file, &dirname))
++#ifdef DBUS_WIN
++ dbusdir = _dbus_get_working_dir();
++ if (dbusdir)
++ parser = bus_config_parser_new (dbusdir, is_toplevel, parent);
++ else
++#endif
++ if (!_dbus_string_get_dirname (file, &dirname))
+ {
+ _DBUS_SET_OOM (error);
+ goto failed;
+ }
++ parser = bus_config_parser_new (&dirname, is_toplevel, parent);
+
+- parser = bus_config_parser_new (&dirname, is_toplevel, parent);
+ if (parser == NULL)
+ {
+ _DBUS_SET_OOM (error);
+Index: bus/policy.c
+===================================================================
+--- bus/policy.c (revision 557)
++++ bus/policy.c (working copy)
+@@ -324,9 +324,13 @@
+
+ if (!dbus_connection_get_unix_user (connection, &uid))
+ {
++#ifdef DBUS_WIN
++ _dbus_verbose ("policy.c: dbus_connection_get_unix_user check disabled under windows\n");
++#else
+ dbus_set_error (error, DBUS_ERROR_FAILED,
+ "No user ID known for connection, cannot determine security policy\n");
+ goto failed;
++#endif
+ }
+
+ if (_dbus_hash_table_get_n_entries (policy->rules_by_uid) > 0)
+Index: bus/dispatch.c
+===================================================================
+--- bus/dispatch.c (revision 557)
++++ bus/dispatch.c (working copy)
+@@ -428,6 +428,11 @@
+ }
+ }
+
++#ifdef DBUS_WIN
++#include <tools/dbus-print-message.h>
++#include <tools/dbus-print-message.c>
++#endif
++
+ static void
+ spin_connection_until_authenticated (BusContext *context,
+ DBusConnection *connection)
+@@ -439,6 +444,19 @@
+ bus_test_run_bus_loop (context, FALSE);
+ bus_test_run_clients_loop (FALSE);
+ }
++#ifdef DBUS_WIN
++ if ( dbus_connection_get_dispatch_status(connection) != DBUS_DISPATCH_COMPLETE)
++ {
++ DBusMessage *message;
++ message = dbus_connection_pop_message (connection);
++ printf ("spin_connection_until_authenticated failed,\n");
++ printf ("because of a non dispatched message:\n");
++ print_message(message, FALSE);
++ printf ("\n");
++ _dbus_assert_not_reached ("spin_connection_until_authenticated failed\n ");
++ }
++#endif
++
+ _dbus_verbose (" ... done spinning to auth connection %p\n", connection);
+ }
+
+@@ -2623,7 +2641,12 @@
+ dbus_bool_t retval;
+ const char *segv_service;
+ dbus_uint32_t flags;
+-
++
++ _dbus_warn("TODO: dispatch.c: check_segfault_service_no_auto_start\n");
++#ifndef DBUS_WIN_FIXME
++ return TRUE;
++#endif
++
+ message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
+ DBUS_PATH_DBUS,
+ DBUS_INTERFACE_DBUS,
+@@ -2698,9 +2721,12 @@
+ }
+ else
+ {
++/* no DBUS_ERROR_NO_MEMORY on windows (no have_fork_errnum)*/
++#ifndef DBUS_WIN_FIXME
+ warn_unexpected (connection, message, "not this error");
+
+ goto out;
++#endif
+ }
+ }
+ else
+@@ -4061,25 +4087,35 @@
+ _dbus_warn ("Messages were left over after setting up initial connections\n");
+ _dbus_assert_not_reached ("initial connection setup failed");
+ }
+-
++
++ _dbus_warn("TODO: dispatch.c create_and_hello test\n");
++#ifndef DBUS_WIN_FIXME
+ check1_try_iterations (context, "create_and_hello",
+ check_hello_connection);
+-
++#endif
++
+ check2_try_iterations (context, foo, "nonexistent_service_no_auto_start",
+ check_nonexistent_service_no_auto_start);
+
++ _dbus_warn("TODO: dispatch.c segfault_service_no_auto_start test\n");
++#ifndef DBUS_WIN_FIXME
+ check2_try_iterations (context, foo, "segfault_service_no_auto_start",
+ check_segfault_service_no_auto_start);
+-
++#endif
++
+ check2_try_iterations (context, foo, "existent_service_no_auto_start",
+ check_existent_service_no_auto_start);
+
+ check2_try_iterations (context, foo, "nonexistent_service_auto_start",
+ check_nonexistent_service_auto_start);
+-
++
++
++ _dbus_warn("TODO: dispatch.c segfault_service_auto_start test\n");
++#ifndef DBUS_WIN_FIXME
+ check2_try_iterations (context, foo, "segfault_service_auto_start",
+ check_segfault_service_auto_start);
+-
++#endif
++
+ check2_try_iterations (context, foo, "shell_fail_service_auto_start",
+ check_shell_fail_service_auto_start);
+
+@@ -4095,8 +4131,11 @@
+ if (!check_existent_service_auto_start (context, foo))
+ _dbus_assert_not_reached ("existent service auto start failed");
+
++ _dbus_warn("TODO: dispatch.c check_shell_service_success_auto_start test\n");
++#ifndef DBUS_WIN_FIXME
+ if (!check_shell_service_success_auto_start (context, foo))
+ _dbus_assert_not_reached ("shell success service auto start failed");
++#endif
+
+ _dbus_verbose ("Disconnecting foo, bar, and baz\n");
+
+@@ -4146,9 +4185,12 @@
+ _dbus_warn ("Messages were left over after setting up initial SHA-1 connection\n");
+ _dbus_assert_not_reached ("initial connection setup failed");
+ }
+-
++
++ _dbus_warn("TODO: dispatch.c: create_and_hello_sha1 test\n");
++#ifndef DBUS_WIN_FIXME
+ check1_try_iterations (context, "create_and_hello_sha1",
+ check_hello_connection);
++#endif
+
+ kill_client_connection_unchecked (foo);
+
+Index: bus/activation.c
+===================================================================
+--- bus/activation.c (revision 557)
++++ bus/activation.c (working copy)
+@@ -34,7 +34,6 @@
+ #include <dbus/dbus-spawn.h>
+ #include <dbus/dbus-timeout.h>
+ #include <dbus/dbus-sysdeps.h>
+-#include <dirent.h>
+ #include <errno.h>
+
+ #define DBUS_SERVICE_SECTION "D-BUS Service"
+@@ -1310,6 +1309,7 @@
+ DBusMessage *message;
+ DBusString service_str;
+ char **argv;
++ char **envp = NULL;
+ int argc;
+ dbus_bool_t retval;
+ DBusHashIter iter;
+@@ -1541,6 +1541,7 @@
+
+ _dbus_verbose ("Spawning %s ...\n", argv[0]);
+ if (!_dbus_spawn_async_with_babysitter (&pending_activation->babysitter, argv,
++ envp,
+ child_setup, activation,
+ error))
+ {
+Index: bus/dir-watch.c
+===================================================================
+--- bus/dir-watch.c (revision 557)
++++ bus/dir-watch.c (working copy)
+@@ -103,7 +103,7 @@
+ }
+
+ void
+-bus_watch_directory (const char *dir, void *userdata)
++bus_watch_directory (const char *dir, BusContext *userdata)
+ {
+ }
+
+Index: bus/connection.c
+===================================================================
+--- bus/connection.c (revision 557)
++++ bus/connection.c (working copy)
+@@ -1536,7 +1536,7 @@
+ {
+ CancelPendingReplyData *d = data;
+
+- _dbus_verbose ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
++ _dbus_verbose_C_S ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
+
+ if (!_dbus_list_remove (&d->connections->pending_replies->items,
+ d->pending))
+@@ -1550,7 +1550,7 @@
+ {
+ CancelPendingReplyData *d = data;
+
+- _dbus_verbose ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
++ _dbus_verbose_C_S ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
+
+ /* d->pending should be either freed or still
+ * in the list of pending replies (owned by someone
+@@ -1687,7 +1687,7 @@
+ {
+ CheckPendingReplyData *d = data;
+
+- _dbus_verbose ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
++ _dbus_verbose_C_S ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
+
+ _dbus_list_prepend_link (&d->connections->pending_replies->items,
+ d->link);
+@@ -1699,7 +1699,7 @@
+ {
+ CheckPendingReplyData *d = data;
+
+- _dbus_verbose ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
++ _dbus_verbose_C_S ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
+
+ if (d->link != NULL)
+ {
+Index: bus/config-parser.c
+===================================================================
+--- bus/config-parser.c (revision 557)
++++ bus/config-parser.c (working copy)
+@@ -27,6 +27,7 @@
+ #include "selinux.h"
+ #include <dbus/dbus-list.h>
+ #include <dbus/dbus-internals.h>
++#include <dbus/dbus-userdb.h>
+ #include <string.h>
+
+ typedef enum
+@@ -3070,10 +3071,15 @@
+
+ static const char *test_service_dir_matches[] =
+ {
++#ifdef DBUS_WIN
++ DBUS_DATADIR"/dbus-1/services",
++ NULL,
++#else
+ "/testusr/testlocal/testshare/dbus-1/services",
+ "/testusr/testshare/dbus-1/services",
+ DBUS_DATADIR"/dbus-1/services",
+- "/testhome/foo/.testlocal/testshare/dbus-1/services",
++ "/testhome/foo/.testlocal/testshare/dbus-1/services",
++#endif
+ NULL
+ };
+
+@@ -3082,11 +3088,32 @@
+ {
+ DBusList *dirs;
+ DBusList *link;
++ DBusString progs;
++ const char *common_progs;
+ int i;
+
++ common_progs = _dbus_getenv ("CommonProgramFiles");
++ if (common_progs)
++ {
++ if (!_dbus_string_init (&progs))
++ return FALSE;
++
++ if (!_dbus_string_append (&progs, common_progs))
++ {
++ _dbus_string_free (&progs);
++ return FALSE;
++ }
++
++ if (!_dbus_string_append (&progs, "/dbus-1/services"))
++ {
++ _dbus_string_free (&progs);
++ return FALSE;
++ }
++ test_service_dir_matches[1] = _dbus_string_get_const_data(&progs);
++ }
+ dirs = NULL;
+
+- printf ("Testing retriving the default session service directories\n");
++ printf ("Testing retrieving the default session service directories\n");
+ if (!_dbus_get_standard_session_servicedirs (&dirs))
+ _dbus_assert_not_reached ("couldn't get stardard dirs");
+
+@@ -3097,7 +3124,7 @@
+
+ printf (" default service dir: %s\n", (char *)link->data);
+ _dbus_string_init_const (&path, (char *)link->data);
+- if (!_dbus_string_ends_with_c_str (&path, "share/dbus-1/services"))
++ if (!_dbus_string_ends_with_c_str (&path, "dbus-1/services"))
+ {
+ printf ("error with default session service directories\n");
+ return FALSE;
+@@ -3150,6 +3177,7 @@
+ return FALSE;
+ }
+
++ _dbus_string_free (&progs);
+ return TRUE;
+ }
+
+Index: bus/main.c
+===================================================================
+--- bus/main.c (revision 557)
++++ bus/main.c (working copy)
+@@ -254,6 +254,12 @@
+ dbus_bool_t print_pid;
+ int force_fork;
+
++#ifdef _WIN32
++ extern int _dbus_init_working_dir(char *s);
++ if (!_dbus_init_working_dir(argv[0]))
++ return 1;
++#endif
++
+ if (!_dbus_string_init (&config_file))
+ return 1;
+
+Index: bus/bus.c
+===================================================================
+--- bus/bus.c (revision 557)
++++ bus/bus.c (working copy)
+@@ -625,7 +625,7 @@
+ }
+
+ bytes = _dbus_string_get_length (&addr);
+- if (_dbus_write_socket (print_addr_fd, &addr, 0, bytes) != bytes)
++ if (_dbus_write_pipe (print_addr_fd, &addr, 0, bytes) != bytes)
+ {
+ dbus_set_error (error, DBUS_ERROR_FAILED,
+ "Printing message bus address: %s\n",
+@@ -726,7 +726,7 @@
+ }
+
+ bytes = _dbus_string_get_length (&pid);
+- if (_dbus_write_socket (print_pid_fd, &pid, 0, bytes) != bytes)
++ if (_dbus_write_pipe (print_pid_fd, &pid, 0, bytes) != bytes)
+ {
+ dbus_set_error (error, DBUS_ERROR_FAILED,
+ "Printing message bus PID: %s\n",
Index: dbus/dbus-auth.c
===================================================================
---- dbus/dbus-auth.c (revision 553)
+--- dbus/dbus-auth.c (revision 557)
+++ dbus/dbus-auth.c (working copy)
@@ -395,7 +395,7 @@
@@ -271,7 +770,7 @@
_dbus_string_get_const_data (&auth->outgoing));
Index: dbus/dbus-spawn.c
===================================================================
---- dbus/dbus-spawn.c (revision 553)
+--- dbus/dbus-spawn.c (revision 557)
+++ dbus/dbus-spawn.c (working copy)
@@ -720,7 +720,7 @@
if (condition & DBUS_WATCH_HANGUP)
@@ -284,7 +783,7 @@
handle_error_pipe (sitter, revents);
Index: dbus/dbus-threads.c
===================================================================
---- dbus/dbus-threads.c (revision 553)
+--- dbus/dbus-threads.c (revision 557)
+++ dbus/dbus-threads.c (working copy)
@@ -810,7 +810,11 @@
dbus_bool_t
@@ -300,7 +799,7 @@
#endif /* DBUS_BUILD_TESTS */
Index: dbus/dbus-spawn.h
===================================================================
---- dbus/dbus-spawn.h (revision 553)
+--- dbus/dbus-spawn.h (revision 557)
+++ dbus/dbus-spawn.h (working copy)
@@ -37,6 +37,7 @@
@@ -312,7 +811,7 @@
DBusError *error);
Index: dbus/dbus-watch.c
===================================================================
---- dbus/dbus-watch.c (revision 553)
+--- dbus/dbus-watch.c (revision 557)
+++ dbus/dbus-watch.c (working copy)
@@ -286,7 +286,7 @@
@@ -403,7 +902,7 @@
if (watch->free_data_function != NULL)
Index: dbus/dbus-mainloop.c
===================================================================
---- dbus/dbus-mainloop.c (revision 553)
+--- dbus/dbus-mainloop.c (revision 557)
+++ dbus/dbus-mainloop.c (working copy)
@@ -90,8 +90,8 @@
Callback callback;
@@ -476,7 +975,7 @@
}
Index: dbus/dbus-bus.c
===================================================================
---- dbus/dbus-bus.c (revision 553)
+--- dbus/dbus-bus.c (revision 557)
+++ dbus/dbus-bus.c (working copy)
@@ -350,8 +350,10 @@
{
@@ -502,7 +1001,7 @@
static DBusConnection *
Index: dbus/dbus-transport-socket.c
===================================================================
---- dbus/dbus-transport-socket.c (revision 553)
+--- dbus/dbus-transport-socket.c (revision 557)
+++ dbus/dbus-transport-socket.c (working copy)
@@ -175,7 +175,7 @@
DBusTransportSocket *socket_transport = (DBusTransportSocket*) transport;
@@ -554,7 +1053,7 @@
"Port is not an integer between 0 and 65535");
Index: dbus/dbus-transport-socket.h
===================================================================
---- dbus/dbus-transport-socket.h (revision 553)
+--- dbus/dbus-transport-socket.h (revision 557)
+++ dbus/dbus-transport-socket.h (working copy)
@@ -25,6 +25,10 @@
@@ -569,7 +1068,7 @@
DBusTransport* _dbus_transport_new_for_socket (int fd,
Index: dbus/dbus-server-unix.c
===================================================================
---- dbus/dbus-server-unix.c (revision 553)
+--- dbus/dbus-server-unix.c (revision 557)
+++ dbus/dbus-server-unix.c (working copy)
@@ -24,9 +24,9 @@
#include "dbus-internals.h"
@@ -681,7 +1180,7 @@
Index: dbus/dbus-transport.c
===================================================================
---- dbus/dbus-transport.c (revision 553)
+--- dbus/dbus-transport.c (revision 557)
+++ dbus/dbus-transport.c (working copy)
@@ -674,7 +674,7 @@
if (transport->disconnected)
@@ -694,7 +1193,7 @@
return TRUE;
Index: dbus/dbus-connection.c
===================================================================
---- dbus/dbus-connection.c (revision 553)
+--- dbus/dbus-connection.c (revision 557)
+++ dbus/dbus-connection.c (working copy)
@@ -62,7 +62,7 @@
#define TRACE_LOCKS 1
@@ -734,7 +1233,7 @@
CONNECTION_LOCK (connection);
Index: dbus/dbus-connection.h
===================================================================
---- dbus/dbus-connection.h (revision 553)
+--- dbus/dbus-connection.h (revision 557)
+++ dbus/dbus-connection.h (working copy)
@@ -330,6 +330,9 @@
*/
@@ -748,7 +1247,7 @@
void dbus_watch_set_data (DBusWatch *watch,
Index: dbus/dbus-test.c
===================================================================
---- dbus/dbus-test.c (revision 553)
+--- dbus/dbus-test.c (revision 557)
+++ dbus/dbus-test.c (working copy)
@@ -156,7 +156,9 @@
@@ -762,7 +1261,7 @@
Index: dbus/dbus-server-socket.c
===================================================================
---- dbus/dbus-server-socket.c (revision 553)
+--- dbus/dbus-server-socket.c (revision 557)
+++ dbus/dbus-server-socket.c (working copy)
@@ -161,7 +161,7 @@
int client_fd;
@@ -796,7 +1295,7 @@
"Port is not an integer between 0 and 65535");
Index: dbus/dbus-server-protected.h
===================================================================
---- dbus/dbus-server-protected.h (revision 553)
+--- dbus/dbus-server-protected.h (revision 557)
+++ dbus/dbus-server-protected.h (working copy)
@@ -144,7 +144,7 @@
#define TRACE_LOCKS 0
@@ -809,7 +1308,7 @@
} while (0)
Index: dbus/dbus-sysdeps-util.c
===================================================================
---- dbus/dbus-sysdeps-util.c (revision 553)
+--- dbus/dbus-sysdeps-util.c (revision 557)
+++ dbus/dbus-sysdeps-util.c (working copy)
@@ -141,6 +141,7 @@
exit (1);
@@ -830,7 +1329,7 @@
check_path_absolute ("c:/foo", TRUE);
Index: dbus/dbus-sysdeps-unix.c
===================================================================
---- dbus/dbus-sysdeps-unix.c (revision 553)
+--- dbus/dbus-sysdeps-unix.c (revision 557)
+++ dbus/dbus-sysdeps-unix.c (working copy)
@@ -169,6 +169,15 @@
return _dbus_write (fd, buffer, start, len);
@@ -914,7 +1413,7 @@
/* tests in dbus-sysdeps-util.c */
Index: dbus/dbus-transport-unix.c
===================================================================
---- dbus/dbus-transport-unix.c (revision 553)
+--- dbus/dbus-transport-unix.c (revision 557)
+++ dbus/dbus-transport-unix.c (working copy)
@@ -23,11 +23,16 @@
@@ -934,21 +1433,9 @@
/**
* @defgroup DBusTransportUnix DBusTransport implementations for UNIX
-Index: dbus/dbus-sysdeps-win.c
-===================================================================
---- dbus/dbus-sysdeps-win.c (revision 553)
-+++ dbus/dbus-sysdeps-win.c (working copy)
-@@ -5089,6 +5089,7 @@
- return FALSE;
- }
-
-+_DBUS_DEFINE_GLOBAL_LOCK (atomic);
-
- /**
- * Atomically increments an integer
Index: dbus/dbus-sysdeps.c
===================================================================
---- dbus/dbus-sysdeps.c (revision 553)
+--- dbus/dbus-sysdeps.c (revision 557)
+++ dbus/dbus-sysdeps.c (working copy)
@@ -119,11 +119,14 @@
* will get upset about.
@@ -979,7 +1466,7 @@
struct lconv *locale_data;
Index: dbus/dbus-sysdeps.h
===================================================================
---- dbus/dbus-sysdeps.h (revision 553)
+--- dbus/dbus-sysdeps.h (revision 557)
+++ dbus/dbus-sysdeps.h (working copy)
@@ -119,6 +119,7 @@
*
@@ -1014,7 +1501,7 @@
/**
Index: dbus/dbus-internals.c
===================================================================
---- dbus/dbus-internals.c (revision 553)
+--- dbus/dbus-internals.c (revision 557)
+++ dbus/dbus-internals.c (working copy)
@@ -295,7 +295,7 @@
#include <pthread.h>
@@ -1025,502 +1512,3 @@
_dbus_verbose_init (void)
{
if (!verbose_initted)
-Index: test/spawn-test.c
-===================================================================
---- test/spawn-test.c (revision 553)
-+++ test/spawn-test.c (working copy)
-@@ -31,7 +31,7 @@
- argv_copy [i] = argv[i + 1];
- argv_copy[argc - 1] = NULL;
-
-- if (!_dbus_spawn_async_with_babysitter (NULL, argv_copy, setup_func, NULL, &error))
-+ if (!_dbus_spawn_async_with_babysitter (NULL, argv_copy, NULL, setup_func, NULL, &error))
- {
- fprintf (stderr, "Could not launch application: \"%s\"\n",
- error.message);
-Index: test/name-test/test-names.c
-===================================================================
---- test/name-test/test-names.c (revision 553)
-+++ test/name-test/test-names.c (working copy)
-@@ -1,9 +1,11 @@
- #include <stdio.h>
- #include <stdlib.h>
--#include <unistd.h>
- #include <string.h>
- #include <dbus/dbus.h>
- #include <dbus/dbus-connection-internal.h>
-+#ifdef HAVE_UNISTD_H
-+#include <unistd.h>
-+#endif
-
- #define REMOVE_CONNECTION 0
- #define ADD_CONNECTION 1
-Index: test/test-utils.c
-===================================================================
---- test/test-utils.c (revision 553)
-+++ test/test-utils.c (working copy)
-@@ -1,5 +1,7 @@
- #include "test-utils.h"
-
-+void _dbus_connection_close_internal (DBusConnection *connection);
-+
- typedef struct
- {
- DBusLoop *loop;
-Index: test/test-segfault.c
-===================================================================
---- test/test-segfault.c (revision 553)
-+++ test/test-segfault.c (working copy)
-@@ -1,10 +1,27 @@
- /* This is simply a process that segfaults */
-+#include <config.h>
- #include <stdlib.h>
- #include <signal.h>
-
-+#ifdef DBUS_WIN
-+#define RLIMIT_CORE 4 /* max core file size */
-+typedef unsigned long rlim_t;
-+struct rlimit {
-+ rlim_t rlim_cur;
-+ rlim_t rlim_max;
-+};
-+static int getrlimit (int __resource, struct rlimit *__rlp) {
-+ return -1;
-+}
-+static int setrlimit (int __resource, const struct rlimit *__rlp) {
-+ return -1;
-+}
-+#else
- #include <sys/time.h>
- #include <sys/resource.h>
-+#endif
-
-+
- int
- main (int argc, char **argv)
- {
-Index: test/Makefile.am
-===================================================================
---- test/Makefile.am (revision 553)
-+++ test/Makefile.am (working copy)
-@@ -117,7 +117,7 @@
- test -d $(top_builddir)/test/$$D || mkdir $(top_builddir)/test/$$D || exit 1 ; \
- done ; \
- if ! (test $(srcdir) = . || test $(srcdir) -ef .) ; then \
-- FILES=`(cd $(srcdir) && $(FIND_TESTS))` ; \
-+ FILES=`(cd $(srcdir) && $(FIND_TESTS) | grep -Ev "(.svn|CVS)" )` ; \
- for F in $$FILES; do \
- SRC=$(srcdir)/$$F ; \
- DEST=$(top_builddir)/test/$$F ; \
-Index: test/test-sleep-forever.c
-===================================================================
---- test/test-sleep-forever.c (revision 553)
-+++ test/test-sleep-forever.c (working copy)
-@@ -1,6 +1,12 @@
- /* This is a process that just sleeps infinitely. */
-
-+
-+#include <config.h>
-+#ifndef DBUS_WIN
- #include <unistd.h>
-+#else
-+#include <stdlib.h>
-+#endif
-
- int
- main (int argc, char **argv)
-Index: bus/config-loader-libxml.c
-===================================================================
---- bus/config-loader-libxml.c (revision 553)
-+++ bus/config-loader-libxml.c (working copy)
-@@ -134,6 +134,9 @@
- }
- }
-
-+#ifdef DBUS_WIN
-+ DBusString *_dbus_get_working_dir(void);
-+#endif
-
- BusConfigParser*
- bus_config_load (const DBusString *file,
-@@ -147,7 +150,9 @@
- DBusString dirname, data;
- DBusError tmp_error;
- int ret;
--
-+#ifdef DBUS_WIN
-+ DBusString *dbusdir;
-+#endif
- _DBUS_ASSERT_ERROR_IS_CLEAR (error);
-
- parser = NULL;
-@@ -177,13 +182,19 @@
- xmlSetGenericErrorFunc (NULL, xml_shut_up);
- }
-
-- if (!_dbus_string_get_dirname (file, &dirname))
-+#ifdef DBUS_WIN
-+ dbusdir = _dbus_get_working_dir();
-+ if (dbusdir)
-+ parser = bus_config_parser_new (dbusdir, is_toplevel, parent);
-+ else
-+#endif
-+ if (!_dbus_string_get_dirname (file, &dirname))
- {
- _DBUS_SET_OOM (error);
- goto failed;
- }
-+ parser = bus_config_parser_new (&dirname, is_toplevel, parent);
-
-- parser = bus_config_parser_new (&dirname, is_toplevel, parent);
- if (parser == NULL)
- {
- _DBUS_SET_OOM (error);
-Index: bus/policy.c
-===================================================================
---- bus/policy.c (revision 553)
-+++ bus/policy.c (working copy)
-@@ -324,9 +324,13 @@
-
- if (!dbus_connection_get_unix_user (connection, &uid))
- {
-+#ifdef DBUS_WIN
-+ _dbus_verbose ("policy.c: dbus_connection_get_unix_user check disabled under windows\n");
-+#else
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "No user ID known for connection, cannot determine security policy\n");
- goto failed;
-+#endif
- }
-
- if (_dbus_hash_table_get_n_entries (policy->rules_by_uid) > 0)
-Index: bus/dispatch.c
-===================================================================
---- bus/dispatch.c (revision 553)
-+++ bus/dispatch.c (working copy)
-@@ -428,6 +428,11 @@
- }
- }
-
-+#ifdef DBUS_WIN
-+#include <tools/dbus-print-message.h>
-+#include <tools/dbus-print-message.c>
-+#endif
-+
- static void
- spin_connection_until_authenticated (BusContext *context,
- DBusConnection *connection)
-@@ -439,6 +444,19 @@
- bus_test_run_bus_loop (context, FALSE);
- bus_test_run_clients_loop (FALSE);
- }
-+#ifdef DBUS_WIN
-+ if ( dbus_connection_get_dispatch_status(connection) != DBUS_DISPATCH_COMPLETE)
-+ {
-+ DBusMessage *message;
-+ message = dbus_connection_pop_message (connection);
-+ printf ("spin_connection_until_authenticated failed,\n");
-+ printf ("because of a non dispatched message:\n");
-+ print_message(message, FALSE);
-+ printf ("\n");
-+ _dbus_assert_not_reached ("spin_connection_until_authenticated failed\n ");
-+ }
-+#endif
-+
- _dbus_verbose (" ... done spinning to auth connection %p\n", connection);
- }
-
-@@ -2623,7 +2641,12 @@
- dbus_bool_t retval;
- const char *segv_service;
- dbus_uint32_t flags;
--
-+
-+ _dbus_warn("TODO: dispatch.c: check_segfault_service_no_auto_start\n");
-+#ifndef DBUS_WIN_FIXME
-+ return TRUE;
-+#endif
-+
- message = dbus_message_new_method_call (DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS,
-@@ -2698,9 +2721,12 @@
- }
- else
- {
-+/* no DBUS_ERROR_NO_MEMORY on windows (no have_fork_errnum)*/
-+#ifndef DBUS_WIN_FIXME
- warn_unexpected (connection, message, "not this error");
-
- goto out;
-+#endif
- }
- }
- else
-@@ -4061,25 +4087,35 @@
- _dbus_warn ("Messages were left over after setting up initial connections\n");
- _dbus_assert_not_reached ("initial connection setup failed");
- }
--
-+
-+ _dbus_warn("TODO: dispatch.c create_and_hello test\n");
-+#ifndef DBUS_WIN_FIXME
- check1_try_iterations (context, "create_and_hello",
- check_hello_connection);
--
-+#endif
-+
- check2_try_iterations (context, foo, "nonexistent_service_no_auto_start",
- check_nonexistent_service_no_auto_start);
-
-+ _dbus_warn("TODO: dispatch.c segfault_service_no_auto_start test\n");
-+#ifndef DBUS_WIN_FIXME
- check2_try_iterations (context, foo, "segfault_service_no_auto_start",
- check_segfault_service_no_auto_start);
--
-+#endif
-+
- check2_try_iterations (context, foo, "existent_service_no_auto_start",
- check_existent_service_no_auto_start);
-
- check2_try_iterations (context, foo, "nonexistent_service_auto_start",
- check_nonexistent_service_auto_start);
--
-+
-+
-+ _dbus_warn("TODO: dispatch.c segfault_service_auto_start test\n");
-+#ifndef DBUS_WIN_FIXME
- check2_try_iterations (context, foo, "segfault_service_auto_start",
- check_segfault_service_auto_start);
--
-+#endif
-+
- check2_try_iterations (context, foo, "shell_fail_service_auto_start",
- check_shell_fail_service_auto_start);
-
-@@ -4095,8 +4131,11 @@
- if (!check_existent_service_auto_start (context, foo))
- _dbus_assert_not_reached ("existent service auto start failed");
-
-+ _dbus_warn("TODO: dispatch.c check_shell_service_success_auto_start test\n");
-+#ifndef DBUS_WIN_FIXME
- if (!check_shell_service_success_auto_start (context, foo))
- _dbus_assert_not_reached ("shell success service auto start failed");
-+#endif
-
- _dbus_verbose ("Disconnecting foo, bar, and baz\n");
-
-@@ -4146,9 +4185,12 @@
- _dbus_warn ("Messages were left over after setting up initial SHA-1 connection\n");
- _dbus_assert_not_reached ("initial connection setup failed");
- }
--
-+
-+ _dbus_warn("TODO: dispatch.c: create_and_hello_sha1 test\n");
-+#ifndef DBUS_WIN_FIXME
- check1_try_iterations (context, "create_and_hello_sha1",
- check_hello_connection);
-+#endif
-
- kill_client_connection_unchecked (foo);
-
-Index: bus/activation.c
-===================================================================
---- bus/activation.c (revision 553)
-+++ bus/activation.c (working copy)
-@@ -34,7 +34,6 @@
- #include <dbus/dbus-spawn.h>
- #include <dbus/dbus-timeout.h>
- #include <dbus/dbus-sysdeps.h>
--#include <dirent.h>
- #include <errno.h>
-
- #define DBUS_SERVICE_SECTION "D-BUS Service"
-@@ -1310,6 +1309,7 @@
- DBusMessage *message;
- DBusString service_str;
- char **argv;
-+ char **envp = NULL;
- int argc;
- dbus_bool_t retval;
- DBusHashIter iter;
-@@ -1541,6 +1541,7 @@
-
- _dbus_verbose ("Spawning %s ...\n", argv[0]);
- if (!_dbus_spawn_async_with_babysitter (&pending_activation->babysitter, argv,
-+ envp,
- child_setup, activation,
- error))
- {
-Index: bus/dir-watch.c
-===================================================================
---- bus/dir-watch.c (revision 553)
-+++ bus/dir-watch.c (working copy)
-@@ -103,7 +103,7 @@
- }
-
- void
--bus_watch_directory (const char *dir, void *userdata)
-+bus_watch_directory (const char *dir, BusContext *userdata)
- {
- }
-
-Index: bus/connection.c
-===================================================================
---- bus/connection.c (revision 553)
-+++ bus/connection.c (working copy)
-@@ -1536,7 +1536,7 @@
- {
- CancelPendingReplyData *d = data;
-
-- _dbus_verbose ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
-+ _dbus_verbose_C_S ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
-
- if (!_dbus_list_remove (&d->connections->pending_replies->items,
- d->pending))
-@@ -1550,7 +1550,7 @@
- {
- CancelPendingReplyData *d = data;
-
-- _dbus_verbose ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
-+ _dbus_verbose_C_S ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
-
- /* d->pending should be either freed or still
- * in the list of pending replies (owned by someone
-@@ -1687,7 +1687,7 @@
- {
- CheckPendingReplyData *d = data;
-
-- _dbus_verbose ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
-+ _dbus_verbose_C_S ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
-
- _dbus_list_prepend_link (&d->connections->pending_replies->items,
- d->link);
-@@ -1699,7 +1699,7 @@
- {
- CheckPendingReplyData *d = data;
-
-- _dbus_verbose ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
-+ _dbus_verbose_C_S ("%s: d = %p\n", _DBUS_FUNCTION_NAME, d);
-
- if (d->link != NULL)
- {
-Index: bus/config-parser.c
-===================================================================
---- bus/config-parser.c (revision 553)
-+++ bus/config-parser.c (working copy)
-@@ -27,6 +27,7 @@
- #include "selinux.h"
- #include <dbus/dbus-list.h>
- #include <dbus/dbus-internals.h>
-+#include <dbus/dbus-userdb.h>
- #include <string.h>
-
- typedef enum
-@@ -3070,10 +3071,15 @@
-
- static const char *test_service_dir_matches[] =
- {
-+#ifdef DBUS_WIN
-+ DBUS_DATADIR"/dbus-1/services",
-+ NULL,
-+#else
- "/testusr/testlocal/testshare/dbus-1/services",
- "/testusr/testshare/dbus-1/services",
- DBUS_DATADIR"/dbus-1/services",
-- "/testhome/foo/.testlocal/testshare/dbus-1/services",
-+ "/testhome/foo/.testlocal/testshare/dbus-1/services",
-+#endif
- NULL
- };
-
-@@ -3082,11 +3088,32 @@
- {
- DBusList *dirs;
- DBusList *link;
-+ DBusString progs;
-+ const char *common_progs;
- int i;
-
-+ common_progs = _dbus_getenv ("CommonProgramFiles");
-+ if (common_progs)
-+ {
-+ if (!_dbus_string_init (&progs))
-+ return FALSE;
-+
-+ if (!_dbus_string_append (&progs, common_progs))
-+ {
-+ _dbus_string_free (&progs);
-+ return FALSE;
-+ }
-+
-+ if (!_dbus_string_append (&progs, "/dbus-1/services"))
-+ {
-+ _dbus_string_free (&progs);
-+ return FALSE;
-+ }
-+ test_service_dir_matches[1] = _dbus_string_get_const_data(&progs);
-+ }
- dirs = NULL;
-
-- printf ("Testing retriving the default session service directories\n");
-+ printf ("Testing retrieving the default session service directories\n");
- if (!_dbus_get_standard_session_servicedirs (&dirs))
- _dbus_assert_not_reached ("couldn't get stardard dirs");
-
-@@ -3097,7 +3124,7 @@
-
- printf (" default service dir: %s\n", (char *)link->data);
- _dbus_string_init_const (&path, (char *)link->data);
-- if (!_dbus_string_ends_with_c_str (&path, "share/dbus-1/services"))
-+ if (!_dbus_string_ends_with_c_str (&path, "dbus-1/services"))
- {
- printf ("error with default session service directories\n");
- return FALSE;
-@@ -3150,6 +3177,7 @@
- return FALSE;
- }
-
-+ _dbus_string_free (&progs);
- return TRUE;
- }
-
-Index: bus/main.c
-===================================================================
---- bus/main.c (revision 553)
-+++ bus/main.c (working copy)
-@@ -254,6 +254,12 @@
- dbus_bool_t print_pid;
- int force_fork;
-
-+#ifdef _WIN32
-+ extern int _dbus_init_working_dir(char *s);
-+ if (!_dbus_init_working_dir(argv[0]))
-+ return 1;
-+#endif
-+
- if (!_dbus_string_init (&config_file))
- return 1;
-
-Index: bus/bus.c
-===================================================================
---- bus/bus.c (revision 553)
-+++ bus/bus.c (working copy)
-@@ -625,7 +625,7 @@
- }
-
- bytes = _dbus_string_get_length (&addr);
-- if (_dbus_write_socket (print_addr_fd, &addr, 0, bytes) != bytes)
-+ if (_dbus_write_pipe (print_addr_fd, &addr, 0, bytes) != bytes)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Printing message bus address: %s\n",
-@@ -726,7 +726,7 @@
- }
-
- bytes = _dbus_string_get_length (&pid);
-- if (_dbus_write_socket (print_pid_fd, &pid, 0, bytes) != bytes)
-+ if (_dbus_write_pipe (print_pid_fd, &pid, 0, bytes) != bytes)
- {
- dbus_set_error (error, DBUS_ERROR_FAILED,
- "Printing message bus PID: %s\n",
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|