From 42cced540ea3df4f46d4561c52eaae8f266184f2 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Thu, 8 Mar 2007 20:33:31 +0000 Subject: * dbus-win.patch: removed _dbus_write_pipe() patch, it is now committed. --- dbus-win.patch | 674 +++++++++++++++++++++++++-------------------------------- 1 file changed, 295 insertions(+), 379 deletions(-) (limited to 'dbus-win.patch') diff --git a/dbus-win.patch b/dbus-win.patch index 39100da0..e4eef318 100644 --- a/dbus-win.patch +++ b/dbus-win.patch @@ -1,68 +1,52 @@ ---- dbus/dbus-connection.c Wed Nov 15 04:07:59 2006 -+++ dbus/dbus-connection.c Thu Mar 08 14:22:09 2007 -@@ -4790,14 +4790,6 @@ - _dbus_return_val_if_fail (connection != NULL, FALSE); - _dbus_return_val_if_fail (uid != NULL, FALSE); - --#ifdef DBUS_WIN -- /* FIXME this should be done at a lower level, but it's kind of hard, -- * just want to be sure we don't ship with this API returning -- * some weird internal fake uid for 1.0 -- */ -- return FALSE; --#endif -- - CONNECTION_LOCK (connection); - - if (!_dbus_transport_get_is_authenticated (connection->transport)) -@@ -4829,14 +4821,6 @@ - _dbus_return_val_if_fail (connection != NULL, FALSE); - _dbus_return_val_if_fail (pid != NULL, FALSE); - --#ifdef DBUS_WIN -- /* FIXME this should be done at a lower level, but it's kind of hard, -- * just want to be sure we don't ship with this API returning -- * some weird internal fake uid for 1.0 -- */ -- return FALSE; --#endif -- - CONNECTION_LOCK (connection); - - if (!_dbus_transport_get_is_authenticated (connection->transport)) -Index: bus/bus.c +? doc/Thumbs.db +Index: bus/config-loader-expat.c =================================================================== -RCS file: /cvs/dbus/dbus/bus/bus.c,v -retrieving revision 1.74 -diff -u -3 -p -B -r1.74 bus.c ---- bus/bus.c 20 Dec 2006 06:18:19 -0000 1.74 -+++ bus/bus.c 6 Mar 2007 20:54:30 -0000 -@@ -625,7 +625,7 @@ bus_context_new (const DBusString *confi - } +RCS file: /cvs/dbus/dbus/bus/config-loader-expat.c,v +retrieving revision 1.10 +diff -u -r1.10 config-loader-expat.c +--- bus/config-loader-expat.c 10 Aug 2004 03:06:59 -0000 1.10 ++++ bus/config-loader-expat.c 8 Mar 2007 20:25:42 -0000 +@@ -161,6 +161,9 @@ + } + } - 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 @@ bus_context_new (const DBusString *confi - } ++#ifdef DBUS_WIN ++DBusString *_dbus_get_working_dir(void); ++#endif - 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", + BusConfigParser* + bus_config_load (const DBusString *file, +@@ -171,6 +174,9 @@ + XML_Parser expat; + const char *filename; + BusConfigParser *parser; ++#ifdef DBUS_WIN ++ DBusString *dbusdir; ++#endif + ExpatParseContext context; + DBusString dirname; + +@@ -209,6 +215,12 @@ + goto failed; + } + ++#ifdef DBUS_WIN ++ dbusdir = _dbus_get_working_dir(); ++ if (dbusdir) ++ parser = bus_config_parser_new (dbusdir, is_toplevel, parent); ++ else ++#endif + parser = bus_config_parser_new (&dirname, is_toplevel, parent); + if (parser == NULL) + { Index: bus/config-loader-libxml.c =================================================================== RCS file: /cvs/dbus/dbus/bus/config-loader-libxml.c,v retrieving revision 1.8 -diff -u -3 -p -B -r1.8 config-loader-libxml.c +diff -u -r1.8 config-loader-libxml.c --- bus/config-loader-libxml.c 10 Aug 2004 03:06:59 -0000 1.8 -+++ bus/config-loader-libxml.c 6 Mar 2007 20:54:31 -0000 -@@ -134,6 +134,9 @@ xml_text_reader_error (void *arg, xmlErr ++++ bus/config-loader-libxml.c 8 Mar 2007 20:25:40 -0000 +@@ -134,6 +134,9 @@ } } @@ -72,7 +56,7 @@ diff -u -3 -p -B -r1.8 config-loader-libxml.c BusConfigParser* bus_config_load (const DBusString *file, -@@ -147,7 +150,9 @@ bus_config_load (const DBusString * +@@ -147,7 +150,9 @@ DBusString dirname, data; DBusError tmp_error; int ret; @@ -83,7 +67,7 @@ diff -u -3 -p -B -r1.8 config-loader-libxml.c _DBUS_ASSERT_ERROR_IS_CLEAR (error); parser = NULL; -@@ -177,13 +182,19 @@ bus_config_load (const DBusString * +@@ -177,13 +182,19 @@ xmlSetGenericErrorFunc (NULL, xml_shut_up); } @@ -108,9 +92,9 @@ Index: bus/config-parser.c =================================================================== RCS file: /cvs/dbus/dbus/bus/config-parser.c,v retrieving revision 1.47 -diff -u -3 -p -B -r1.47 config-parser.c +diff -u -r1.47 config-parser.c --- bus/config-parser.c 26 Jan 2007 16:10:09 -0000 1.47 -+++ bus/config-parser.c 6 Mar 2007 20:54:31 -0000 ++++ bus/config-parser.c 8 Mar 2007 20:25:40 -0000 @@ -27,6 +27,7 @@ #include "selinux.h" #include @@ -119,7 +103,7 @@ diff -u -3 -p -B -r1.47 config-parser.c #include typedef enum -@@ -3070,10 +3071,15 @@ process_test_equiv_subdir (const DBusStr +@@ -3070,10 +3071,15 @@ static const char *test_service_dir_matches[] = { @@ -135,7 +119,7 @@ diff -u -3 -p -B -r1.47 config-parser.c NULL }; -@@ -3082,11 +3088,32 @@ test_default_session_servicedirs (void) +@@ -3082,11 +3088,32 @@ { DBusList *dirs; DBusList *link; @@ -169,7 +153,7 @@ diff -u -3 -p -B -r1.47 config-parser.c if (!_dbus_get_standard_session_servicedirs (&dirs)) _dbus_assert_not_reached ("couldn't get stardard dirs"); -@@ -3097,7 +3124,7 @@ test_default_session_servicedirs (void) +@@ -3097,7 +3124,7 @@ printf (" default service dir: %s\n", (char *)link->data); _dbus_string_init_const (&path, (char *)link->data); @@ -178,7 +162,7 @@ diff -u -3 -p -B -r1.47 config-parser.c { printf ("error with default session service directories\n"); return FALSE; -@@ -3150,6 +3177,7 @@ test_default_session_servicedirs (void) +@@ -3150,6 +3177,7 @@ return FALSE; } @@ -186,14 +170,150 @@ diff -u -3 -p -B -r1.47 config-parser.c return TRUE; } +Index: bus/dispatch.c +=================================================================== +RCS file: /cvs/dbus/dbus/bus/dispatch.c,v +retrieving revision 1.79 +diff -u -r1.79 dispatch.c +--- bus/dispatch.c 8 Mar 2007 08:30:17 -0000 1.79 ++++ bus/dispatch.c 8 Mar 2007 20:25:42 -0000 +@@ -34,7 +34,7 @@ + #include "test.h" + #include + #include +- ++ + static dbus_bool_t + send_one_message (DBusConnection *connection, + BusContext *context, +@@ -428,6 +428,11 @@ + } + } + ++#ifdef DBUS_WIN ++#include ++#include ++#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); + } + +@@ -2699,9 +2717,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 +@@ -2812,7 +2833,7 @@ + return retval; + } + #endif +- ++ + #define TEST_ECHO_MESSAGE "Test echo message" + #define TEST_RUN_HELLO_FROM_SELF_MESSAGE "Test sending message to self" + +@@ -4064,29 +4085,36 @@ + _dbus_assert_not_reached ("initial connection setup failed"); + } + ++#ifdef DBUS_WIN_FIXME ++ _dbus_warn("TODO: dispatch.c create_and_hello test\n"); ++#else + 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); + +-#ifdef DBUS_WIN_FIXME ++#ifdef DBUS_WIN_FIXME + _dbus_warn("TODO: dispatch.c segfault_service_no_auto_start test\n"); + #else + check2_try_iterations (context, foo, "segfault_service_no_auto_start", + check_segfault_service_no_auto_start); + #endif + ++#ifdef DBUS_WIN_FIXME ++ _dbus_warn("TODO: dispatch.c existent_service_no_auto_start\n"); ++#else + 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); +- ++#endif + + #ifdef DBUS_WIN_FIXME + _dbus_warn("TODO: dispatch.c segfault_service_auto_start test\n"); +-#else ++#else + check2_try_iterations (context, foo, "segfault_service_auto_start", + check_segfault_service_auto_start); + #endif +@@ -4106,8 +4134,12 @@ + if (!check_existent_service_auto_start (context, foo)) + _dbus_assert_not_reached ("existent service auto start failed"); + ++#ifdef DBUS_WIN_FIXME ++ _dbus_warn("TODO: dispatch.c check_shell_service_success_auto_start test\n"); ++#else + 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"); + +@@ -4158,8 +4190,12 @@ + _dbus_assert_not_reached ("initial connection setup failed"); + } + ++#ifdef DBUS_WIN_FIXME ++ _dbus_warn("TODO: dispatch.c: create_and_hello_sha1 test\n"); ++#else + check1_try_iterations (context, "create_and_hello_sha1", + check_hello_connection); ++#endif + + kill_client_connection_unchecked (foo); + Index: bus/main.c =================================================================== RCS file: /cvs/dbus/dbus/bus/main.c,v retrieving revision 1.36 -diff -u -3 -p -B -r1.36 main.c +diff -u -r1.36 main.c --- bus/main.c 20 Dec 2006 06:18:19 -0000 1.36 -+++ bus/main.c 6 Mar 2007 20:54:33 -0000 -@@ -254,6 +254,12 @@ main (int argc, char **argv) ++++ bus/main.c 8 Mar 2007 20:25:40 -0000 +@@ -254,6 +254,12 @@ dbus_bool_t print_pid; int force_fork; @@ -210,10 +330,10 @@ Index: bus/policy.c =================================================================== RCS file: /cvs/dbus/dbus/bus/policy.c,v retrieving revision 1.24 -diff -u -3 -p -B -r1.24 policy.c +diff -u -r1.24 policy.c --- bus/policy.c 12 Dec 2006 21:24:07 -0000 1.24 -+++ bus/policy.c 6 Mar 2007 20:54:33 -0000 -@@ -324,9 +324,13 @@ bus_policy_create_client_policy (BusPoli ++++ bus/policy.c 8 Mar 2007 20:25:40 -0000 +@@ -324,9 +324,13 @@ if (!dbus_connection_get_unix_user (connection, &uid)) { @@ -231,10 +351,10 @@ Index: dbus/dbus-bus.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-bus.c,v retrieving revision 1.64 -diff -u -3 -p -B -r1.64 dbus-bus.c +diff -u -r1.64 dbus-bus.c --- dbus/dbus-bus.c 28 Oct 2006 01:41:37 -0000 1.64 -+++ dbus/dbus-bus.c 6 Mar 2007 20:54:33 -0000 -@@ -350,8 +350,10 @@ _dbus_bus_notify_shared_connection_disco ++++ dbus/dbus-bus.c 8 Mar 2007 20:25:40 -0000 +@@ -350,8 +350,10 @@ { int i; @@ -246,7 +366,7 @@ diff -u -3 -p -B -r1.64 dbus-bus.c /* 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 -@@ -366,7 +368,9 @@ _dbus_bus_notify_shared_connection_disco +@@ -366,7 +368,9 @@ } } @@ -256,14 +376,51 @@ diff -u -3 -p -B -r1.64 dbus-bus.c } static DBusConnection * +Index: dbus/dbus-connection.c +=================================================================== +RCS file: /cvs/dbus/dbus/dbus/dbus-connection.c,v +retrieving revision 1.154 +diff -u -r1.154 dbus-connection.c +--- dbus/dbus-connection.c 15 Nov 2006 03:07:59 -0000 1.154 ++++ dbus/dbus-connection.c 8 Mar 2007 20:25:37 -0000 +@@ -4790,14 +4790,6 @@ + _dbus_return_val_if_fail (connection != NULL, FALSE); + _dbus_return_val_if_fail (uid != NULL, FALSE); + +-#ifdef DBUS_WIN +- /* FIXME this should be done at a lower level, but it's kind of hard, +- * just want to be sure we don't ship with this API returning +- * some weird internal fake uid for 1.0 +- */ +- return FALSE; +-#endif +- + CONNECTION_LOCK (connection); + + if (!_dbus_transport_get_is_authenticated (connection->transport)) +@@ -4829,14 +4821,6 @@ + _dbus_return_val_if_fail (connection != NULL, FALSE); + _dbus_return_val_if_fail (pid != NULL, FALSE); + +-#ifdef DBUS_WIN +- /* FIXME this should be done at a lower level, but it's kind of hard, +- * just want to be sure we don't ship with this API returning +- * some weird internal fake uid for 1.0 +- */ +- return FALSE; +-#endif +- + CONNECTION_LOCK (connection); + + if (!_dbus_transport_get_is_authenticated (connection->transport)) Index: dbus/dbus-connection.h =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-connection.h,v retrieving revision 1.49 -diff -u -3 -p -B -r1.49 dbus-connection.h +diff -u -r1.49 dbus-connection.h --- dbus/dbus-connection.h 15 Nov 2006 03:07:59 -0000 1.49 -+++ dbus/dbus-connection.h 6 Mar 2007 20:54:40 -0000 -@@ -330,6 +330,9 @@ dbus_bool_t dbus_connection_get_socket ++++ dbus/dbus-connection.h 8 Mar 2007 20:25:40 -0000 +@@ -330,6 +330,9 @@ */ int dbus_watch_get_fd (DBusWatch *watch); @@ -277,10 +434,10 @@ Index: dbus/dbus-internals.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-internals.c,v retrieving revision 1.55 -diff -u -3 -p -B -r1.55 dbus-internals.c +diff -u -r1.55 dbus-internals.c --- dbus/dbus-internals.c 15 Nov 2006 01:52:01 -0000 1.55 -+++ dbus/dbus-internals.c 6 Mar 2007 20:54:40 -0000 -@@ -295,7 +295,7 @@ static dbus_bool_t verbose = TRUE; ++++ dbus/dbus-internals.c 8 Mar 2007 20:25:40 -0000 +@@ -295,7 +295,7 @@ #include #endif @@ -293,10 +450,10 @@ Index: dbus/dbus-mainloop.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-mainloop.c,v retrieving revision 1.19 -diff -u -3 -p -B -r1.19 dbus-mainloop.c +diff -u -r1.19 dbus-mainloop.c --- dbus/dbus-mainloop.c 20 Oct 2006 03:04:59 -0000 1.19 -+++ dbus/dbus-mainloop.c 6 Mar 2007 20:54:40 -0000 -@@ -90,8 +90,8 @@ typedef struct ++++ dbus/dbus-mainloop.c 8 Mar 2007 20:25:40 -0000 +@@ -90,8 +90,8 @@ Callback callback; DBusTimeout *timeout; DBusTimeoutFunction function; @@ -307,7 +464,7 @@ diff -u -3 -p -B -r1.19 dbus-mainloop.c } TimeoutCallback; #define WATCH_CALLBACK(callback) ((WatchCallback*)callback) -@@ -598,7 +598,7 @@ _dbus_loop_iterate (DBusLoop *loop, +@@ -598,7 +598,7 @@ #if MAINLOOP_SPEW _dbus_verbose (" skipping watch on fd %d as it was out of memory last time\n", @@ -316,7 +473,7 @@ diff -u -3 -p -B -r1.19 dbus-mainloop.c #endif } else if (dbus_watch_get_enabled (wcb->watch)) -@@ -609,7 +609,7 @@ _dbus_loop_iterate (DBusLoop *loop, +@@ -609,7 +609,7 @@ flags = dbus_watch_get_flags (wcb->watch); @@ -325,7 +482,7 @@ diff -u -3 -p -B -r1.19 dbus-mainloop.c fds[n_fds].revents = 0; fds[n_fds].events = 0; if (flags & DBUS_WATCH_READABLE) -@@ -628,7 +628,7 @@ _dbus_loop_iterate (DBusLoop *loop, +@@ -628,7 +628,7 @@ { #if MAINLOOP_SPEW _dbus_verbose (" skipping disabled watch on fd %d %s\n", @@ -334,7 +491,7 @@ diff -u -3 -p -B -r1.19 dbus-mainloop.c watch_flags_to_string (dbus_watch_get_flags (wcb->watch))); #endif } -@@ -640,8 +640,8 @@ _dbus_loop_iterate (DBusLoop *loop, +@@ -640,8 +640,8 @@ timeout = -1; if (loop->timeout_count > 0) { @@ -345,7 +502,7 @@ diff -u -3 -p -B -r1.19 dbus-mainloop.c _dbus_get_current_time (&tv_sec, &tv_usec); -@@ -710,8 +710,8 @@ _dbus_loop_iterate (DBusLoop *loop, +@@ -710,8 +710,8 @@ if (loop->timeout_count > 0) { @@ -356,7 +513,7 @@ diff -u -3 -p -B -r1.19 dbus-mainloop.c _dbus_get_current_time (&tv_sec, &tv_usec); -@@ -883,6 +883,8 @@ _dbus_loop_quit (DBusLoop *loop) +@@ -883,6 +883,8 @@ loop->depth -= 1; @@ -369,10 +526,10 @@ Index: dbus/dbus-server-socket.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-server-socket.c,v retrieving revision 1.3 -diff -u -3 -p -B -r1.3 dbus-server-socket.c +diff -u -r1.3 dbus-server-socket.c --- dbus/dbus-server-socket.c 1 Oct 2006 15:36:18 -0000 1.3 -+++ dbus/dbus-server-socket.c 6 Mar 2007 20:54:42 -0000 -@@ -161,7 +161,7 @@ socket_handle_watch (DBusWatch *watch ++++ dbus/dbus-server-socket.c 8 Mar 2007 20:25:40 -0000 +@@ -161,7 +161,7 @@ int client_fd; int listen_fd; @@ -381,7 +538,7 @@ diff -u -3 -p -B -r1.3 dbus-server-socket.c client_fd = _dbus_accept (listen_fd); -@@ -393,15 +393,19 @@ _dbus_server_listen_socket (DBusAddressE +@@ -393,15 +393,19 @@ if (port == NULL) { @@ -406,10 +563,10 @@ Index: dbus/dbus-server.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-server.c,v retrieving revision 1.54 -diff -u -3 -p -B -r1.54 dbus-server.c +diff -u -r1.54 dbus-server.c --- dbus/dbus-server.c 21 Oct 2006 23:09:18 -0000 1.54 -+++ dbus/dbus-server.c 6 Mar 2007 20:54:42 -0000 -@@ -509,8 +509,10 @@ static const struct { ++++ dbus/dbus-server.c 8 Mar 2007 20:25:40 -0000 +@@ -509,8 +509,10 @@ DBusServer **server_p, DBusError *error); } listen_funcs[] = { @@ -422,7 +579,7 @@ diff -u -3 -p -B -r1.54 dbus-server.c #ifdef DBUS_BUILD_TESTS , { _dbus_server_listen_debug_pipe } #endif -@@ -1114,6 +1116,13 @@ dbus_server_get_data (DBusServer *serv +@@ -1114,6 +1116,13 @@ dbus_bool_t _dbus_server_test (void) { @@ -436,7 +593,7 @@ diff -u -3 -p -B -r1.54 dbus-server.c const char *valid_addresses[] = { "tcp:port=1234", "unix:path=./boogie", -@@ -1121,7 +1130,7 @@ _dbus_server_test (void) +@@ -1121,7 +1130,7 @@ "tcp:host=localhost,port=1234;tcp:port=5678", "tcp:port=1234;unix:path=./boogie", }; @@ -449,10 +606,10 @@ Index: dbus/dbus-spawn.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-spawn.c,v retrieving revision 1.25 -diff -u -3 -p -B -r1.25 dbus-spawn.c +diff -u -r1.25 dbus-spawn.c --- dbus/dbus-spawn.c 4 Mar 2007 19:14:03 -0000 1.25 -+++ dbus/dbus-spawn.c 6 Mar 2007 20:54:43 -0000 -@@ -720,7 +720,7 @@ handle_watch (DBusWatch *watch, ++++ dbus/dbus-spawn.c 8 Mar 2007 20:25:40 -0000 +@@ -720,7 +720,7 @@ if (condition & DBUS_WATCH_HANGUP) revents |= _DBUS_POLLHUP; @@ -461,47 +618,14 @@ diff -u -3 -p -B -r1.25 dbus-spawn.c if (fd == sitter->error_pipe_from_child) handle_error_pipe (sitter, revents); -Index: dbus/dbus-sysdeps-unix.c -=================================================================== -RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps-unix.c,v -retrieving revision 1.19 -diff -u -3 -p -B -r1.19 dbus-sysdeps-unix.c ---- dbus/dbus-sysdeps-unix.c 3 Mar 2007 10:36:45 -0000 1.19 -+++ dbus/dbus-sysdeps-unix.c 6 Mar 2007 20:54:43 -0000 -@@ -169,6 +169,15 @@ _dbus_write_socket (int fd - return _dbus_write (fd, buffer, start, len); - } - -+int -+_dbus_write_pipe (DBusPipe pipe, -+ const DBusString *buffer, -+ int start, -+ int len) -+{ -+ return _dbus_write (pipe, buffer, start, len); -+} -+ - /** - * Like _dbus_write_two() but only works on sockets and is thus - * available on Windows. -@@ -2840,4 +2896,9 @@ _dbus_get_standard_session_servicedirs ( - return FALSE; - } - -+// non empty implementation in the Windows code -+void _dbus_daemon_release() -+{ -+} -+ - /* tests in dbus-sysdeps-util.c */ Index: dbus/dbus-sysdeps-util.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps-util.c,v retrieving revision 1.10 -diff -u -3 -p -B -r1.10 dbus-sysdeps-util.c +diff -u -r1.10 dbus-sysdeps-util.c --- dbus/dbus-sysdeps-util.c 13 Dec 2006 01:18:07 -0000 1.10 -+++ dbus/dbus-sysdeps-util.c 6 Mar 2007 20:54:43 -0000 -@@ -82,7 +82,7 @@ _dbus_sysdeps_test (void) ++++ dbus/dbus-sysdeps-util.c 8 Mar 2007 20:25:41 -0000 +@@ -82,7 +82,7 @@ double val; int pos; @@ -510,7 +634,7 @@ diff -u -3 -p -B -r1.10 dbus-sysdeps-util.c check_dirname ("foo\\bar", "foo"); check_dirname ("foo\\\\bar", "foo"); check_dirname ("foo/\\/bar", "foo"); -@@ -141,6 +141,7 @@ _dbus_sysdeps_test (void) +@@ -141,6 +141,7 @@ exit (1); } @@ -518,7 +642,7 @@ diff -u -3 -p -B -r1.10 dbus-sysdeps-util.c _dbus_string_init_const (&str, "0xff"); if (!_dbus_string_parse_double (&str, 0, &val, &pos)) -@@ -158,6 +159,8 @@ _dbus_sysdeps_test (void) +@@ -158,6 +159,8 @@ _dbus_warn ("_dbus_string_parse_double of \"0xff\" returned wrong position %d", pos); exit (1); } @@ -531,10 +655,10 @@ Index: dbus/dbus-sysdeps.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps.c,v retrieving revision 1.120 -diff -u -3 -p -B -r1.120 dbus-sysdeps.c +diff -u -r1.120 dbus-sysdeps.c --- dbus/dbus-sysdeps.c 1 Jan 2007 21:29:59 -0000 1.120 -+++ dbus/dbus-sysdeps.c 6 Mar 2007 20:54:43 -0000 -@@ -119,11 +119,14 @@ _dbus_setenv (const char *varname, ++++ dbus/dbus-sysdeps.c 8 Mar 2007 20:25:41 -0000 +@@ -119,11 +119,14 @@ * will get upset about. */ @@ -544,13 +668,13 @@ diff -u -3 -p -B -r1.120 dbus-sysdeps.c return FALSE; strcpy (putenv_value, varname); -+#if defined(DBUS_WIN) || defined(DBUS_WINCE) ++#if defined(DBUS_WIN) + strcat (putenv_value, "="); +#endif return (putenv (putenv_value) == 0); #endif -@@ -413,6 +416,10 @@ static double +@@ -413,6 +416,10 @@ ascii_strtod (const char *nptr, char **endptr) { @@ -564,11 +688,11 @@ diff -u -3 -p -B -r1.120 dbus-sysdeps.c Index: dbus/dbus-sysdeps.h =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps.h,v -retrieving revision 1.68 -diff -u -3 -p -B -r1.68 dbus-sysdeps.h ---- dbus/dbus-sysdeps.h 31 Dec 2006 12:16:04 -0000 1.68 -+++ dbus/dbus-sysdeps.h 6 Mar 2007 20:54:43 -0000 -@@ -119,6 +119,7 @@ typedef unsigned long dbus_gid_t; +retrieving revision 1.69 +diff -u -r1.69 dbus-sysdeps.h +--- dbus/dbus-sysdeps.h 8 Mar 2007 20:25:15 -0000 1.69 ++++ dbus/dbus-sysdeps.h 8 Mar 2007 20:25:41 -0000 +@@ -119,6 +119,7 @@ * */ @@ -576,27 +700,14 @@ diff -u -3 -p -B -r1.68 dbus-sysdeps.h dbus_bool_t _dbus_open_tcp_socket (int *fd, DBusError *error); dbus_bool_t _dbus_close_socket (int fd, -@@ -302,6 +303,12 @@ dbus_bool_t _dbus_path_is_absolute (c - - dbus_bool_t _dbus_get_standard_session_servicedirs (DBusList **dirs); - -+typedef int DBusPipe; -+int _dbus_write_pipe (DBusPipe pipe, -+ const DBusString *buffer, -+ int start, -+ int len); -+ - /** Opaque type for reading a directory listing */ - typedef struct DBusDirIter DBusDirIter; - Index: dbus/dbus-test.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-test.c,v retrieving revision 1.44 -diff -u -3 -p -B -r1.44 dbus-test.c +diff -u -r1.44 dbus-test.c --- dbus/dbus-test.c 15 Nov 2006 03:07:59 -0000 1.44 -+++ dbus/dbus-test.c 6 Mar 2007 20:54:43 -0000 -@@ -156,7 +156,9 @@ dbus_internal_do_not_use_run_tests (cons ++++ dbus/dbus-test.c 8 Mar 2007 20:25:41 -0000 +@@ -156,7 +156,9 @@ run_test ("hash", specific_test, _dbus_hash_test); @@ -610,10 +721,10 @@ Index: dbus/dbus-threads.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-threads.c,v retrieving revision 1.36 -diff -u -3 -p -B -r1.36 dbus-threads.c +diff -u -r1.36 dbus-threads.c --- dbus/dbus-threads.c 28 Oct 2006 01:41:37 -0000 1.36 -+++ dbus/dbus-threads.c 6 Mar 2007 20:54:44 -0000 -@@ -810,7 +810,11 @@ dbus_fake_condvar_wake_all (DBusCondVar ++++ dbus/dbus-threads.c 8 Mar 2007 20:25:41 -0000 +@@ -810,7 +810,11 @@ dbus_bool_t _dbus_threads_init_debug (void) { @@ -625,50 +736,13 @@ diff -u -3 -p -B -r1.36 dbus-threads.c } #endif /* DBUS_BUILD_TESTS */ -Index: dbus/dbus-transport-socket.c -=================================================================== -RCS file: /cvs/dbus/dbus/dbus/dbus-transport-socket.c,v -retrieving revision 1.4 -diff -u -3 -p -B -r1.4 dbus-transport-socket.c ---- dbus/dbus-transport-socket.c 20 Oct 2006 03:05:00 -0000 1.4 -+++ dbus/dbus-transport-socket.c 6 Mar 2007 20:54:44 -0000 -@@ -873,7 +873,7 @@ socket_handle_watch (DBusTransport *tran - flags); - else - _dbus_verbose ("asked to handle watch %p on fd %d that we don't recognize\n", -- watch, dbus_watch_get_fd (watch)); -+ watch, dbus_watch_get_handle (watch)); - } - #endif /* DBUS_ENABLE_VERBOSE_MODE */ - -@@ -1286,15 +1286,19 @@ _dbus_transport_open_socket(DBusAddressE - - if (port == NULL) - { -+#if defined(DBUS_WIN) -+ port = "0"; -+#else - _dbus_set_bad_address (error, "tcp", "port", NULL); - return DBUS_TRANSPORT_OPEN_BAD_ADDRESS; -+#endif - } - - _dbus_string_init_const (&str, port); - sresult = _dbus_string_parse_int (&str, 0, &lport, NULL); - _dbus_string_free (&str); - -- if (sresult == FALSE || lport <= 0 || lport > 65535) -+ if (sresult == FALSE || lport < 0 || lport > 65535) - { - _dbus_set_bad_address (error, NULL, NULL, - "Port is not an integer between 0 and 65535"); Index: dbus/dbus-transport-socket.h =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-transport-socket.h,v retrieving revision 1.2 -diff -u -3 -p -B -r1.2 dbus-transport-socket.h +diff -u -r1.2 dbus-transport-socket.h --- dbus/dbus-transport-socket.h 16 Sep 2006 19:24:08 -0000 1.2 -+++ dbus/dbus-transport-socket.h 6 Mar 2007 20:54:44 -0000 ++++ dbus/dbus-transport-socket.h 8 Mar 2007 20:25:42 -0000 @@ -25,6 +25,10 @@ #include @@ -684,10 +758,10 @@ Index: dbus/dbus-transport.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-transport.c,v retrieving revision 1.54 -diff -u -3 -p -B -r1.54 dbus-transport.c +diff -u -r1.54 dbus-transport.c --- dbus/dbus-transport.c 17 Oct 2006 20:52:13 -0000 1.54 -+++ dbus/dbus-transport.c 6 Mar 2007 20:54:45 -0000 -@@ -310,9 +310,11 @@ static const struct { ++++ dbus/dbus-transport.c 8 Mar 2007 20:25:42 -0000 +@@ -310,9 +310,11 @@ DBusTransport **transport_p, DBusError *error); } open_funcs[] = { @@ -702,7 +776,7 @@ diff -u -3 -p -B -r1.54 dbus-transport.c #ifdef DBUS_BUILD_TESTS , { _dbus_transport_open_debug_pipe } #endif -@@ -674,7 +676,7 @@ _dbus_transport_handle_watch (DBusTransp +@@ -674,7 +676,7 @@ if (transport->disconnected) return TRUE; @@ -715,10 +789,10 @@ Index: dbus/dbus-watch.c =================================================================== RCS file: /cvs/dbus/dbus/dbus/dbus-watch.c,v retrieving revision 1.22 -diff -u -3 -p -B -r1.22 dbus-watch.c +diff -u -r1.22 dbus-watch.c --- dbus/dbus-watch.c 21 Oct 2006 21:57:31 -0000 1.22 -+++ dbus/dbus-watch.c 6 Mar 2007 20:54:45 -0000 -@@ -286,7 +286,7 @@ _dbus_watch_list_set_functions (DBusWatc ++++ dbus/dbus-watch.c 8 Mar 2007 20:25:42 -0000 +@@ -286,7 +286,7 @@ _dbus_verbose ("Adding a %s watch on fd %d using newly-set add watch function\n", watch_type, @@ -727,7 +801,7 @@ diff -u -3 -p -B -r1.22 dbus-watch.c } #endif /* DBUS_ENABLE_VERBOSE_MODE */ -@@ -302,7 +302,7 @@ _dbus_watch_list_set_functions (DBusWatc +@@ -302,7 +302,7 @@ link2); _dbus_verbose ("Removing watch on fd %d using newly-set remove function because initial add failed\n", @@ -736,7 +810,7 @@ diff -u -3 -p -B -r1.22 dbus-watch.c (* remove_function) (link2->data, data); -@@ -359,7 +359,7 @@ _dbus_watch_list_add_watch (DBusWatchLis +@@ -359,7 +359,7 @@ if (watch_list->add_watch_function != NULL) { _dbus_verbose ("Adding watch on fd %d\n", @@ -745,7 +819,7 @@ diff -u -3 -p -B -r1.22 dbus-watch.c if (!(* watch_list->add_watch_function) (watch, watch_list->watch_data)) -@@ -390,7 +390,7 @@ _dbus_watch_list_remove_watch (DBusWatc +@@ -390,7 +390,7 @@ if (watch_list->remove_watch_function != NULL) { _dbus_verbose ("Removing watch on fd %d\n", @@ -754,7 +828,7 @@ diff -u -3 -p -B -r1.22 dbus-watch.c (* watch_list->remove_watch_function) (watch, watch_list->watch_data); -@@ -422,7 +422,7 @@ _dbus_watch_list_toggle_watch (DBusWatch +@@ -422,7 +422,7 @@ if (watch_list->watch_toggled_function != NULL) { _dbus_verbose ("Toggling watch %p on fd %d to %d\n", @@ -763,7 +837,7 @@ diff -u -3 -p -B -r1.22 dbus-watch.c (* watch_list->watch_toggled_function) (watch, watch_list->watch_data); -@@ -490,10 +490,32 @@ _dbus_watch_set_handler (DBusWatch +@@ -490,10 +490,32 @@ * @returns the file descriptor to watch. */ int @@ -796,7 +870,7 @@ diff -u -3 -p -B -r1.22 dbus-watch.c /** * Gets flags from DBusWatchFlags indicating -@@ -546,7 +568,7 @@ dbus_watch_set_data (DBusWatch *w +@@ -546,7 +568,7 @@ DBusFreeFunction free_data_function) { _dbus_verbose ("Setting watch fd %d data to data = %p function = %p from data = %p function = %p\n", @@ -805,161 +879,3 @@ diff -u -3 -p -B -r1.22 dbus-watch.c data, free_data_function, watch->data, watch->free_data_function); if (watch->free_data_function != NULL) -Index: bus/dispatch.c -=================================================================== -RCS file: /cvs/dbus/dbus/bus/dispatch.c,v -retrieving revision 1.79 -diff -u -r1.79 dispatch.c ---- bus/dispatch.c 8 Mar 2007 08:30:17 -0000 1.79 -+++ bus/dispatch.c 8 Mar 2007 19:37:34 -0000 -@@ -428,6 +428,11 @@ - } - } - -+#ifdef DBUS_WIN -+#include -+#include -+#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); - } - -@@ -2699,9 +2717,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 -@@ -4064,29 +4085,36 @@ - _dbus_assert_not_reached ("initial connection setup failed"); - } - -+#ifdef DBUS_WIN_FIXME -+ _dbus_warn("TODO: dispatch.c create_and_hello test\n"); -+#else - 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); - --#ifdef DBUS_WIN_FIXME -+#ifdef DBUS_WIN_FIXME - _dbus_warn("TODO: dispatch.c segfault_service_no_auto_start test\n"); - #else - check2_try_iterations (context, foo, "segfault_service_no_auto_start", - check_segfault_service_no_auto_start); - #endif - -+#ifdef DBUS_WIN_FIXME -+ _dbus_warn("TODO: dispatch.c existent_service_no_auto_start\n"); -+#else - 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); -- -+#endif - - #ifdef DBUS_WIN_FIXME - _dbus_warn("TODO: dispatch.c segfault_service_auto_start test\n"); --#else -+#else - check2_try_iterations (context, foo, "segfault_service_auto_start", - check_segfault_service_auto_start); - #endif -@@ -4106,8 +4134,12 @@ - if (!check_existent_service_auto_start (context, foo)) - _dbus_assert_not_reached ("existent service auto start failed"); - -+#ifdef DBUS_WIN_FIXME -+ _dbus_warn("TODO: dispatch.c check_shell_service_success_auto_start test\n"); -+#else - 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"); - -@@ -4158,8 +4190,12 @@ - _dbus_assert_not_reached ("initial connection setup failed"); - } - -+#ifdef DBUS_WIN_FIXME -+ _dbus_warn("TODO: dispatch.c: create_and_hello_sha1 test\n"); -+#else - check1_try_iterations (context, "create_and_hello_sha1", - check_hello_connection); -+#endif - - kill_client_connection_unchecked (foo); - -Index: bus/config-loader-expat.c -=================================================================== -RCS file: /cvs/dbus/dbus/bus/config-loader-expat.c,v -retrieving revision 1.10 -diff -u -r1.10 config-loader-expat.c ---- bus/config-loader-expat.c 10 Aug 2004 03:06:59 -0000 1.10 -+++ bus/config-loader-expat.c 8 Mar 2007 19:00:25 -0000 -@@ -161,6 +161,9 @@ - } - } - -+#ifdef DBUS_WIN -+DBusString *_dbus_get_working_dir(void); -+#endif - - BusConfigParser* - bus_config_load (const DBusString *file, -@@ -171,6 +174,9 @@ - XML_Parser expat; - const char *filename; - BusConfigParser *parser; -+#ifdef DBUS_WIN -+ DBusString *dbusdir; -+#endif - ExpatParseContext context; - DBusString dirname; - -@@ -209,6 +215,12 @@ - goto failed; - } - -+#ifdef DBUS_WIN -+ dbusdir = _dbus_get_working_dir(); -+ if (dbusdir) -+ parser = bus_config_parser_new (dbusdir, is_toplevel, parent); -+ else -+#endif - parser = bus_config_parser_new (&dirname, is_toplevel, parent); - if (parser == NULL) - { -- cgit