[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/lisp/net dbus.el
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] emacs/lisp/net dbus.el |
Date: |
Tue, 25 Aug 2009 10:13:54 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Michael Albinus <albinus> 09/08/25 10:13:54
Modified files:
lisp/net : dbus.el
Log message:
* net/dbus.el (dbus-ping): Add optional parameter TIMEOUT.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/net/dbus.el?cvsroot=emacs&r1=1.34&r2=1.35
Patches:
Index: dbus.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/dbus.el,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- dbus.el 21 Aug 2009 06:43:24 -0000 1.34
+++ dbus.el 25 Aug 2009 10:13:54 -0000 1.35
@@ -493,13 +493,26 @@
bus dbus-service-dbus dbus-path-dbus
dbus-interface-dbus "GetNameOwner" service)))
-(defun dbus-ping (bus service)
- "Check whether SERVICE is registered for D-Bus BUS."
+(defun dbus-ping (bus service &optional timeout)
+ "Check whether SERVICE is registered for D-Bus BUS.
+TIMEOUT, a nonnegative integer, specifies the maximum number of
+milliseconds `dbus-ping' must return. The default value is 25,000.
+
+Note, that this autoloads SERVICE if it is not running yet. If
+it shall be checked whether SERVICE is already running, one shall
+apply
+
+ \(member service \(dbus-list-known-names bus))"
;; "Ping" raises a D-Bus error if SERVICE does not exist.
;; Otherwise, it returns silently with `nil'.
(condition-case nil
(not
- (dbus-call-method bus service dbus-path-dbus dbus-interface-peer
"Ping"))
+ (if (natnump timeout)
+ (dbus-call-method
+ bus service dbus-path-dbus dbus-interface-peer
+ "Ping" :timeout timeout)
+ (dbus-call-method
+ bus service dbus-path-dbus dbus-interface-peer "Ping")))
(dbus-error nil)))