]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Bug#17858
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 4 Jul 2014 10:03:14 +0000 (12:03 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Fri, 4 Jul 2014 10:03:14 +0000 (12:03 +0200)
* net/dbus.el (dbus-peer-handler): New defun.
(dbus-register-service): Register it.
(dbus-managed-objects-handler): Fix docstring.

lisp/ChangeLog
lisp/net/dbus.el

index ed9a1100d495f1138d868a3d9ecac76c9dde5eca..5c91db50037db67771cc056bc1d4cb3cdb74955e 100644 (file)
@@ -1,3 +1,9 @@
+2014-07-04  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/dbus.el (dbus-peer-handler): New defun.
+       (dbus-register-service): Register it.  (Bug#17858)
+       (dbus-managed-objects-handler): Fix docstring.
+
 2014-07-04  Phil Sainty  <psainty@orcon.net.nz>  (tiny change)
 
        * emacs-lisp/lisp.el (narrow-to-defun-include-comments): New var.
        Remove HISTFILE and HISTSIZE; it's too late to set them here.
        Add :version entry.
        (tramp-open-shell): Do not let-bind `tramp-end-of-output'.
-       Add "HISTSIZE=/dev/null" to the shell's env arguments.  Do not send
+       Add "HISTFILE=/dev/null" to the shell's env arguments.  Do not send
        extra "PSx=..." commands.
        (tramp-maybe-open-connection): Setenv HISTFILE to /dev/null.
        (Bug#17295)
 2014-03-10  Michael Albinus  <michael.albinus@gmx.de>
 
        * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
-       Do not add `nil' to the environment, when there's no remote `locale'.
+       Do not add nil to the environment, when there's no remote `locale'.
        (tramp-find-inline-encoding): Check, that the remote host has
        installed perl, before sending scripts.
 
index 66170dafef8a813c8f75d3b817ae610dbb0bff38..582f54faf4e91c17f0ee6e857553ff692776b2da 100644 (file)
@@ -544,6 +544,10 @@ placed in the queue.
 
 `:already-owner': Service is already the primary owner."
 
+  ;; Add Peer handler.
+  (dbus-register-method
+   bus service nil dbus-interface-peer "Ping" 'dbus-peer-handler 'dont-register)
+
   ;; Add ObjectManager handler.
   (dbus-register-method
    bus service nil dbus-interface-objectmanager "GetManagedObjects"
@@ -1151,6 +1155,22 @@ apply
          bus service dbus-path-dbus dbus-interface-peer "Ping")))
     (dbus-error nil)))
 
+(defun dbus-peer-handler ()
+  "Default handler for the \"org.freedesktop.DBus.Peer\" interface.
+It will be registered for all objects created by `dbus-register-service'."
+  (let* ((last-input-event last-input-event)
+        (method (dbus-event-member-name last-input-event)))
+    (cond
+     ;; "Ping" does not return an output parameter.
+     ((string-equal method "Ping")
+      :ignore)
+     ;; "GetMachineId" returns "s".
+     ((string-equal method "GetMachineId")
+      (signal
+       'dbus-error
+       (list
+       (format "%s.GetMachineId not implemented" dbus-interface-peer)))))))
+
 \f
 ;;; D-Bus introspection.
 
@@ -1672,7 +1692,7 @@ and \"org.freedesktop.DBus.Properties.GetAll\", which is slow."
 
 (defun dbus-managed-objects-handler ()
   "Default handler for the \"org.freedesktop.DBus.ObjectManager\" interface.
-It will be registered for all objects created by `dbus-register-method'."
+It will be registered for all objects created by `dbus-register-service'."
   (let* ((last-input-event last-input-event)
         (bus (dbus-event-bus-name last-input-event))
         (path (dbus-event-path-name last-input-event)))