1 Index: bus/config-loader-expat.c
2 ===================================================================
3 RCS file: /cvs/dbus/dbus/bus/config-loader-expat.c,v
4 retrieving revision 1.10
5 diff -u -r1.10 config-loader-expat.c
6 --- bus/config-loader-expat.c 10 Aug 2004 03:06:59 -0000 1.10
7 +++ bus/config-loader-expat.c 8 Mar 2007 20:25:42 -0000
13 +DBusString *_dbus_get_working_dir(void);
17 bus_config_load (const DBusString *file,
21 BusConfigParser *parser;
23 + DBusString *dbusdir;
25 ExpatParseContext context;
33 + dbusdir = _dbus_get_working_dir();
35 + parser = bus_config_parser_new (dbusdir, is_toplevel, parent);
38 parser = bus_config_parser_new (&dirname, is_toplevel, parent);
41 Index: bus/config-loader-libxml.c
42 ===================================================================
43 RCS file: /cvs/dbus/dbus/bus/config-loader-libxml.c,v
44 retrieving revision 1.8
45 diff -u -r1.8 config-loader-libxml.c
46 --- bus/config-loader-libxml.c 10 Aug 2004 03:06:59 -0000 1.8
47 +++ bus/config-loader-libxml.c 8 Mar 2007 20:25:40 -0000
53 + DBusString *_dbus_get_working_dir(void);
57 bus_config_load (const DBusString *file,
59 DBusString dirname, data;
64 + DBusString *dbusdir;
66 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
70 xmlSetGenericErrorFunc (NULL, xml_shut_up);
74 + dbusdir = _dbus_get_working_dir();
76 + parser = bus_config_parser_new (dbusdir, is_toplevel, parent);
79 if (!_dbus_string_get_dirname (file, &dirname))
81 _DBUS_SET_OOM (error);
85 parser = bus_config_parser_new (&dirname, is_toplevel, parent);
89 _DBUS_SET_OOM (error);
91 ===================================================================
92 RCS file: /cvs/dbus/dbus/bus/dispatch.c,v
93 retrieving revision 1.79
94 diff -u -r1.79 dispatch.c
95 --- bus/dispatch.c 8 Mar 2007 08:30:17 -0000 1.79
96 +++ bus/dispatch.c 8 Mar 2007 20:25:42 -0000
99 #include <dbus/dbus-internals.h>
104 send_one_message (DBusConnection *connection,
111 +#include <tools/dbus-print-message.h>
112 +#include <tools/dbus-print-message.c>
116 spin_connection_until_authenticated (BusContext *context,
117 DBusConnection *connection)
119 bus_test_run_bus_loop (context, FALSE);
120 bus_test_run_clients_loop (FALSE);
123 + if ( dbus_connection_get_dispatch_status(connection) != DBUS_DISPATCH_COMPLETE)
125 + DBusMessage *message;
126 + message = dbus_connection_pop_message (connection);
127 + printf ("spin_connection_until_authenticated failed,\n");
128 + printf ("because of a non dispatched message:\n");
129 + print_message(message, FALSE);
131 + _dbus_assert_not_reached ("spin_connection_until_authenticated failed\n ");
135 _dbus_verbose (" ... done spinning to auth connection %p\n", connection);
138 @@ -2699,9 +2717,12 @@
142 +/* no DBUS_ERROR_NO_MEMORY on windows (no have_fork_errnum)*/
143 +#ifndef DBUS_WIN_FIXME
144 warn_unexpected (connection, message, "not this error");
151 @@ -2812,7 +2833,7 @@
157 #define TEST_ECHO_MESSAGE "Test echo message"
158 #define TEST_RUN_HELLO_FROM_SELF_MESSAGE "Test sending message to self"
160 @@ -4064,29 +4085,36 @@
161 _dbus_assert_not_reached ("initial connection setup failed");
164 +#ifdef DBUS_WIN_FIXME
165 + _dbus_warn("TODO: dispatch.c create_and_hello test\n");
167 check1_try_iterations (context, "create_and_hello",
168 check_hello_connection);
171 check2_try_iterations (context, foo, "nonexistent_service_no_auto_start",
172 check_nonexistent_service_no_auto_start);
174 -#ifdef DBUS_WIN_FIXME
175 +#ifdef DBUS_WIN_FIXME
176 _dbus_warn("TODO: dispatch.c segfault_service_no_auto_start test\n");
178 check2_try_iterations (context, foo, "segfault_service_no_auto_start",
179 check_segfault_service_no_auto_start);
182 +#ifdef DBUS_WIN_FIXME
183 + _dbus_warn("TODO: dispatch.c existent_service_no_auto_start\n");
185 check2_try_iterations (context, foo, "existent_service_no_auto_start",
186 check_existent_service_no_auto_start);
188 check2_try_iterations (context, foo, "nonexistent_service_auto_start",
189 check_nonexistent_service_auto_start);
193 #ifdef DBUS_WIN_FIXME
194 _dbus_warn("TODO: dispatch.c segfault_service_auto_start test\n");
197 check2_try_iterations (context, foo, "segfault_service_auto_start",
198 check_segfault_service_auto_start);
200 @@ -4106,8 +4134,12 @@
201 if (!check_existent_service_auto_start (context, foo))
202 _dbus_assert_not_reached ("existent service auto start failed");
204 +#ifdef DBUS_WIN_FIXME
205 + _dbus_warn("TODO: dispatch.c check_shell_service_success_auto_start test\n");
207 if (!check_shell_service_success_auto_start (context, foo))
208 _dbus_assert_not_reached ("shell success service auto start failed");
211 _dbus_verbose ("Disconnecting foo, bar, and baz\n");
213 @@ -4158,8 +4190,12 @@
214 _dbus_assert_not_reached ("initial connection setup failed");
217 +#ifdef DBUS_WIN_FIXME
218 + _dbus_warn("TODO: dispatch.c: create_and_hello_sha1 test\n");
220 check1_try_iterations (context, "create_and_hello_sha1",
221 check_hello_connection);
224 kill_client_connection_unchecked (foo);
227 ===================================================================
228 RCS file: /cvs/dbus/dbus/bus/main.c,v
229 retrieving revision 1.36
230 diff -u -r1.36 main.c
231 --- bus/main.c 20 Dec 2006 06:18:19 -0000 1.36
232 +++ bus/main.c 8 Mar 2007 20:25:40 -0000
234 dbus_bool_t print_pid;
238 + extern int _dbus_init_working_dir(char *s);
239 + if (!_dbus_init_working_dir(argv[0]))
243 if (!_dbus_string_init (&config_file))
246 Index: dbus/dbus-bus.c
247 ===================================================================
248 RCS file: /cvs/dbus/dbus/dbus/dbus-bus.c,v
249 retrieving revision 1.64
250 diff -u -r1.64 dbus-bus.c
251 --- dbus/dbus-bus.c 28 Oct 2006 01:41:37 -0000 1.64
252 +++ dbus/dbus-bus.c 8 Mar 2007 20:25:40 -0000
257 +#if !defined(DBUS_WIN) && !defined(DBUS_WINCE)
258 + // qt example pong says "QMutex::lock: Deadlock detected"
262 /* We are expecting to have the connection saved in only one of these
263 * slots, but someone could in a pathological case set system and session
264 * bus to the same bus or something. Or set one of them to the starter
269 +#if !defined(DBUS_WIN) && !defined(DBUS_WINCE)
274 static DBusConnection *
275 Index: dbus/dbus-connection.c
276 ===================================================================
277 RCS file: /cvs/dbus/dbus/dbus/dbus-connection.c,v
278 retrieving revision 1.154
279 diff -u -r1.154 dbus-connection.c
280 --- dbus/dbus-connection.c 15 Nov 2006 03:07:59 -0000 1.154
281 +++ dbus/dbus-connection.c 8 Mar 2007 20:25:37 -0000
282 @@ -4790,14 +4790,6 @@
283 _dbus_return_val_if_fail (connection != NULL, FALSE);
284 _dbus_return_val_if_fail (uid != NULL, FALSE);
287 - /* FIXME this should be done at a lower level, but it's kind of hard,
288 - * just want to be sure we don't ship with this API returning
289 - * some weird internal fake uid for 1.0
294 CONNECTION_LOCK (connection);
296 if (!_dbus_transport_get_is_authenticated (connection->transport))
297 @@ -4829,14 +4821,6 @@
298 _dbus_return_val_if_fail (connection != NULL, FALSE);
299 _dbus_return_val_if_fail (pid != NULL, FALSE);
302 - /* FIXME this should be done at a lower level, but it's kind of hard,
303 - * just want to be sure we don't ship with this API returning
304 - * some weird internal fake uid for 1.0
309 CONNECTION_LOCK (connection);
311 if (!_dbus_transport_get_is_authenticated (connection->transport))
312 Index: dbus/dbus-connection.h
313 ===================================================================
314 RCS file: /cvs/dbus/dbus/dbus/dbus-connection.h,v
315 retrieving revision 1.49
316 diff -u -r1.49 dbus-connection.h
317 --- dbus/dbus-connection.h 15 Nov 2006 03:07:59 -0000 1.49
318 +++ dbus/dbus-connection.h 8 Mar 2007 20:25:40 -0000
322 int dbus_watch_get_fd (DBusWatch *watch);
323 +#if defined (DBUS_COMPILATION)
324 +int dbus_watch_get_handle (DBusWatch *watch);
326 unsigned int dbus_watch_get_flags (DBusWatch *watch);
327 void* dbus_watch_get_data (DBusWatch *watch);
328 void dbus_watch_set_data (DBusWatch *watch,
329 Index: dbus/dbus-mainloop.c
330 ===================================================================
331 RCS file: /cvs/dbus/dbus/dbus/dbus-mainloop.c,v
332 retrieving revision 1.19
333 diff -u -r1.19 dbus-mainloop.c
334 --- dbus/dbus-mainloop.c 20 Oct 2006 03:04:59 -0000 1.19
335 +++ dbus/dbus-mainloop.c 8 Mar 2007 20:25:40 -0000
339 _dbus_verbose (" skipping watch on fd %d as it was out of memory last time\n",
340 - dbus_watch_get_fd (wcb->watch));
341 + dbus_watch_get_handle (wcb->watch));
344 else if (dbus_watch_get_enabled (wcb->watch))
347 flags = dbus_watch_get_flags (wcb->watch);
349 - fds[n_fds].fd = dbus_watch_get_fd (wcb->watch);
350 + fds[n_fds].fd = dbus_watch_get_handle (wcb->watch);
351 fds[n_fds].revents = 0;
352 fds[n_fds].events = 0;
353 if (flags & DBUS_WATCH_READABLE)
357 _dbus_verbose (" skipping disabled watch on fd %d %s\n",
358 - dbus_watch_get_fd (wcb->watch),
359 + dbus_watch_get_handle (wcb->watch),
360 watch_flags_to_string (dbus_watch_get_flags (wcb->watch)));
367 + _dbus_daemon_release ();
369 _dbus_verbose ("Quit main loop, depth %d -> %d\n",
370 loop->depth + 1, loop->depth);
372 Index: dbus/dbus-server-socket.c
373 ===================================================================
374 RCS file: /cvs/dbus/dbus/dbus/dbus-server-socket.c,v
375 retrieving revision 1.3
376 diff -u -r1.3 dbus-server-socket.c
377 --- dbus/dbus-server-socket.c 1 Oct 2006 15:36:18 -0000 1.3
378 +++ dbus/dbus-server-socket.c 8 Mar 2007 20:25:40 -0000
383 - listen_fd = dbus_watch_get_fd (watch);
384 + listen_fd = dbus_watch_get_handle (watch);
386 client_fd = _dbus_accept (listen_fd);
388 Index: dbus/dbus-spawn.c
389 ===================================================================
390 RCS file: /cvs/dbus/dbus/dbus/dbus-spawn.c,v
391 retrieving revision 1.25
392 diff -u -r1.25 dbus-spawn.c
393 --- dbus/dbus-spawn.c 4 Mar 2007 19:14:03 -0000 1.25
394 +++ dbus/dbus-spawn.c 8 Mar 2007 20:25:40 -0000
396 if (condition & DBUS_WATCH_HANGUP)
397 revents |= _DBUS_POLLHUP;
399 - fd = dbus_watch_get_fd (watch);
400 + fd = dbus_watch_get_handle (watch);
402 if (fd == sitter->error_pipe_from_child)
403 handle_error_pipe (sitter, revents);
404 Index: dbus/dbus-sysdeps-util.c
405 ===================================================================
406 RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps-util.c,v
407 retrieving revision 1.10
408 diff -u -r1.10 dbus-sysdeps-util.c
409 --- dbus/dbus-sysdeps-util.c 13 Dec 2006 01:18:07 -0000 1.10
410 +++ dbus/dbus-sysdeps-util.c 8 Mar 2007 20:25:41 -0000
416 +#if defined(DBUS_WIN) || defined(DBUS_WINCE)
417 check_dirname ("foo\\bar", "foo");
418 check_dirname ("foo\\\\bar", "foo");
419 check_dirname ("foo/\\/bar", "foo");
424 +#ifndef DBUS_WIN_FIXME
425 _dbus_string_init_const (&str, "0xff");
426 if (!_dbus_string_parse_double (&str,
429 _dbus_warn ("_dbus_string_parse_double of \"0xff\" returned wrong position %d", pos);
435 check_path_absolute ("c:/", TRUE);
436 check_path_absolute ("c:/foo", TRUE);
437 Index: dbus/dbus-sysdeps.h
438 ===================================================================
439 RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps.h,v
440 retrieving revision 1.69
441 diff -u -r1.69 dbus-sysdeps.h
442 --- dbus/dbus-sysdeps.h 8 Mar 2007 20:25:15 -0000 1.69
443 +++ dbus/dbus-sysdeps.h 8 Mar 2007 20:25:41 -0000
448 +void _dbus_daemon_release (void);
449 dbus_bool_t _dbus_open_tcp_socket (int *fd,
451 dbus_bool_t _dbus_close_socket (int fd,
452 Index: dbus/dbus-threads.c
453 ===================================================================
454 RCS file: /cvs/dbus/dbus/dbus/dbus-threads.c,v
455 retrieving revision 1.36
456 diff -u -r1.36 dbus-threads.c
457 --- dbus/dbus-threads.c 28 Oct 2006 01:41:37 -0000 1.36
458 +++ dbus/dbus-threads.c 8 Mar 2007 20:25:41 -0000
461 _dbus_threads_init_debug (void)
463 +#if defined(DBUS_WIN)
464 + return _dbus_threads_init_platform_specific();
466 return dbus_threads_init (&fake_functions);
470 #endif /* DBUS_BUILD_TESTS */
471 Index: dbus/dbus-transport-socket.h
472 ===================================================================
473 RCS file: /cvs/dbus/dbus/dbus/dbus-transport-socket.h,v
474 retrieving revision 1.2
475 diff -u -r1.2 dbus-transport-socket.h
476 --- dbus/dbus-transport-socket.h 16 Sep 2006 19:24:08 -0000 1.2
477 +++ dbus/dbus-transport-socket.h 8 Mar 2007 20:25:42 -0000
480 #include <dbus/dbus-transport-protected.h>
482 +#if defined(DBUS_WIN)
483 +#include <dbus/dbus-sockets-win.h>
488 DBusTransport* _dbus_transport_new_for_socket (int fd,
489 Index: dbus/dbus-transport.c
490 ===================================================================
491 RCS file: /cvs/dbus/dbus/dbus/dbus-transport.c,v
492 retrieving revision 1.54
493 diff -u -r1.54 dbus-transport.c
494 --- dbus/dbus-transport.c 17 Oct 2006 20:52:13 -0000 1.54
495 +++ dbus/dbus-transport.c 8 Mar 2007 20:25:42 -0000
497 DBusTransport **transport_p,
500 - { _dbus_transport_open_socket },
501 - { _dbus_transport_open_platform_specific },
502 - { _dbus_transport_open_autolaunch }
503 + { _dbus_transport_open_socket }
505 + , { _dbus_transport_open_platform_specific }
507 + , { _dbus_transport_open_autolaunch }
508 #ifdef DBUS_BUILD_TESTS
509 , { _dbus_transport_open_debug_pipe }
512 if (transport->disconnected)
515 - if (dbus_watch_get_fd (watch) < 0)
516 + if (dbus_watch_get_handle (watch) < 0)
518 _dbus_warn_check_failed ("Tried to handle an invalidated watch; this watch should have been removed\n");
520 Index: dbus/dbus-watch.c
521 ===================================================================
522 RCS file: /cvs/dbus/dbus/dbus/dbus-watch.c,v
523 retrieving revision 1.22
524 diff -u -r1.22 dbus-watch.c
525 --- dbus/dbus-watch.c 21 Oct 2006 21:57:31 -0000 1.22
526 +++ dbus/dbus-watch.c 8 Mar 2007 20:25:42 -0000
529 _dbus_verbose ("Adding a %s watch on fd %d using newly-set add watch function\n",
531 - dbus_watch_get_fd (link->data));
532 + dbus_watch_get_handle (link->data));
534 #endif /* DBUS_ENABLE_VERBOSE_MODE */
539 _dbus_verbose ("Removing watch on fd %d using newly-set remove function because initial add failed\n",
540 - dbus_watch_get_fd (link2->data));
541 + dbus_watch_get_handle (link2->data));
543 (* remove_function) (link2->data, data);
546 if (watch_list->add_watch_function != NULL)
548 _dbus_verbose ("Adding watch on fd %d\n",
549 - dbus_watch_get_fd (watch));
550 + dbus_watch_get_handle (watch));
552 if (!(* watch_list->add_watch_function) (watch,
553 watch_list->watch_data))
555 if (watch_list->remove_watch_function != NULL)
557 _dbus_verbose ("Removing watch on fd %d\n",
558 - dbus_watch_get_fd (watch));
559 + dbus_watch_get_handle (watch));
561 (* watch_list->remove_watch_function) (watch,
562 watch_list->watch_data);
564 if (watch_list->watch_toggled_function != NULL)
566 _dbus_verbose ("Toggling watch %p on fd %d to %d\n",
567 - watch, dbus_watch_get_fd (watch), watch->enabled);
568 + watch, dbus_watch_get_handle (watch), watch->enabled);
570 (* watch_list->watch_toggled_function) (watch,
571 watch_list->watch_data);
572 @@ -490,10 +490,32 @@
573 * @returns the file descriptor to watch.
576 +dbus_watch_get_handle (DBusWatch *watch)
581 +#if defined(DBUS_WIN)
582 +// never used by the dbus code
583 +#include "dbus-sysdeps-win.h"
585 +dbus_watch_get_fd (DBusWatch *watch)
588 + if (watch->fd != -1) {
589 + _dbus_handle_to_socket(watch->fd,&p);
597 dbus_watch_get_fd (DBusWatch *watch)
604 * Gets flags from DBusWatchFlags indicating
606 DBusFreeFunction free_data_function)
608 _dbus_verbose ("Setting watch fd %d data to data = %p function = %p from data = %p function = %p\n",
609 - dbus_watch_get_fd (watch),
610 + dbus_watch_get_handle (watch),
611 data, free_data_function, watch->data, watch->free_data_function);
613 if (watch->free_data_function != NULL)