+++ /dev/null
-Index: dbus/dbus-spawn.c
-===================================================================
-RCS file: /cvs/dbus/dbus/dbus/dbus-spawn.c,v
-retrieving revision 1.20
-diff -u -p -r1.20 dbus-spawn.c
---- dbus/dbus-spawn.c 10 Nov 2004 20:12:15 -0000 1.20
-+++ dbus/dbus-spawn.c 28 Jun 2005 15:08:59 -0000
-@@ -252,6 +252,9 @@ _dbus_babysitter_ref (DBusBabysitter *si
-
- /**
- * Decrement the reference count on the babysitter object.
-+ * When the reference count of the babysitter object reaches
-+ * zero, the babysitter is killed and the child that was being
-+ * babysat gets emancipated.
- *
- * @param sitter the babysitter
- */
-@@ -266,6 +269,13 @@ _dbus_babysitter_unref (DBusBabysitter *
- {
- if (sitter->socket_to_babysitter >= 0)
- {
-+ /* If we haven't forked other babysitters
-+ * since this babysitter and socket were
-+ * created then this close will cause the
-+ * babysitter to wake up from poll with
-+ * a hangup and then the babysitter will
-+ * quit itself.
-+ */
- close (sitter->socket_to_babysitter);
- sitter->socket_to_babysitter = -1;
- }
-@@ -276,14 +286,27 @@ _dbus_babysitter_unref (DBusBabysitter *
- sitter->error_pipe_from_child = -1;
- }
-
-- if (sitter->sitter_pid != -1)
-+ if (sitter->sitter_pid > 0)
- {
- int status;
- int ret;
-
-- /* Reap the babysitter */
-+ /* It's possible the babysitter died on its own above
-+ * from the close, or was killed randomly
-+ * by some other process, so first try to reap it
-+ */
-+ ret = waitpid (sitter->sitter_pid, &status, WNOHANG);
-+
-+ /* If we couldn't reap the child then kill it, and
-+ * try again
-+ */
-+ if (ret == 0)
-+ kill (sitter->sitter_pid, SIGKILL);
-+
- again:
-- ret = waitpid (sitter->sitter_pid, &status, 0);
-+ if (ret == 0)
-+ ret = waitpid (sitter->sitter_pid, &status, 0);
-+
- if (ret < 0)
- {
- if (errno == EINTR)
+++ /dev/null
---- dbus/python/dbus_bindings.pyx.in.orig 2005-06-16 01:51:46.000000000 -0400
-+++ dbus/python/dbus_bindings.pyx.in 2005-06-28 15:23:44.000000000 -0400
-@@ -34,6 +34,10 @@
- void Py_XINCREF (object)
- void Py_XDECREF (object)
- object PyString_FromStringAndSize(char *, int)
-+ ctypedef void *PyGILState_STATE
-+ void PyErr_Clear()
-+ PyGILState_STATE PyGILState_Ensure()
-+ void PyGILState_Release(PyGILState_STATE)
-
- ctypedef struct DBusError:
- char *name
-@@ -158,38 +162,46 @@
- cdef void cunregister_function_handler (DBusConnection *connection,
- void *user_data):
- cdef Connection conn
-- tup = <object>user_data
-- assert (type(tup) == list)
-- function = tup[1]
-- conn = Connection()
-- conn.__cinit__(None, connection)
-+ cdef PyGILState_STATE gil
-
-- args = [conn]
-- function(*args)
-+ gil = PyGILState_Ensure()
-+ try:
-+ itup = <object>user_data
-+ assert (type(tup) == list)
-+ function = tup[1]
-+ conn = Connection()
-+ conn.__cinit__(None, connection)
-+
-+ args = [conn]
-+ function(*args)
-+ finally:
-+ PyGILState_Release(gil)
-
- cdef DBusHandlerResult cmessage_function_handler (DBusConnection *connection,
- DBusMessage *msg,
- void *user_data):
- cdef Connection conn
- cdef Message message
-+ cdef PyGILState_STATE gil
-
-- tup = <object>user_data
-- assert (type(tup) == list)
-- function = tup[0]
-- message = Message(_create=0)
-- message._set_msg(msg)
--
-- conn = Connection()
-- conn.__cinit__(None, connection)
--
-- args = [conn,
-- message]
-- retval = function(*args)
-- if (retval == None):
-- retval = DBUS_HANDLER_RESULT_HANDLED
--
-- return retval
--
-+ gil = PyGILState_Ensure()
-+ try:
-+ tup = <object>user_data
-+ assert (type(tup) == list)
-+ function = tup[0]
-+ message = Message(_create=0)
-+ message._set_msg(msg)
-+ conn = Connection()
-+ conn.__cinit__(None, connection)
-+ args = [conn,
-+ message]
-+ retval = function(*args)
-+ if (retval == None):
-+ retval = DBUS_HANDLER_RESULT_HANDLED
-+ return retval
-+ finally:
-+ PyGILState_Release(gil)
-+
- cdef class Connection:
- cdef DBusConnection *conn
-