emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116450: Make closing dbus buses actually work


From: Daniel Colascione
Subject: [Emacs-diffs] trunk r116450: Make closing dbus buses actually work
Date: Sun, 16 Feb 2014 05:46:18 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116450 [merge]
revision-id: address@hidden
parent: address@hidden
parent: address@hidden
committer: Daniel Colascione <address@hidden>
branch nick: trunk
timestamp: Sat 2014-02-15 21:46:05 -0800
message:
  Make closing dbus buses actually work
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/dbusbind.c                 dbusbind.c-20091113204419-o5vbwnq5f7feedwu-7961
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-02-13 20:54:07 +0000
+++ b/src/ChangeLog     2014-02-16 05:43:44 +0000
@@ -1,3 +1,11 @@
+2014-02-16  Daniel Colascione  <address@hidden>
+
+       * dbusbind.c (xd_lisp_dbus_to_dbus): New function.
+       (xd_get_connection_address): Use it.
+       (xd_close_bus): Use xd_lisp_dbus_to_dbus to instead of
+       xd_get_connection_address because the latter signals if the bus
+       we're trying to close is already disconnected.
+
 2014-02-13  Eli Zaretskii  <address@hidden>
 
        * w32proc.c (start_timer_thread): Pass a non-NULL pointer as last

=== modified file 'src/dbusbind.c'
--- a/src/dbusbind.c    2014-01-01 07:43:34 +0000
+++ b/src/dbusbind.c    2014-02-16 05:43:44 +0000
@@ -973,6 +973,13 @@
   return *refcount;
 }
 
+/* Convert a Lisp dbus object to a pointer */
+static DBusConnection*
+xd_lisp_dbus_to_dbus (Lisp_Object bus)
+{
+  return (DBusConnection *) (intptr_t) XFASTINT (bus);
+}
+
 /* Return D-Bus connection address.  BUS is either a Lisp symbol,
    :system or :session, or a string denoting the bus address.  */
 static DBusConnection *
@@ -985,7 +992,7 @@
   if (NILP (val))
     XD_SIGNAL2 (build_string ("No connection to bus"), bus);
   else
-    connection = (DBusConnection *) (intptr_t) XFASTINT (val);
+    connection = xd_lisp_dbus_to_dbus (val);
 
   if (!dbus_connection_get_is_connected (connection))
     XD_SIGNAL2 (build_string ("No connection to bus"), bus);
@@ -1080,14 +1087,21 @@
 {
   DBusConnection *connection;
   Lisp_Object val;
+  Lisp_Object busobj;
 
   /* Check whether we are connected.  */
   val = Fassoc (bus, xd_registered_buses);
   if (NILP (val))
     return;
 
+  busobj = CDR_SAFE(val);
+  if (NILP (val)) {
+    xd_registered_buses = Fdelete (val, xd_registered_buses);
+    return;
+  }
+
   /* Retrieve bus address.  */
-  connection = xd_get_connection_address (bus);
+  connection = xd_lisp_dbus_to_dbus (busobj);
 
   if (xd_get_connection_references (connection) == 1)
     {


reply via email to

[Prev in Thread] Current Thread [Next in Thread]