summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Zeuthen <david@fubar.dk>2005-05-23 14:06:27 +0000
committerDavid Zeuthen <david@fubar.dk>2005-05-23 14:06:27 +0000
commit940d821e1daa550f7f3ed7029f921c45f33b4c26 (patch)
treed1eea55c7bdeeb1b5051dc306890088f5903493d /examples
parentf1d6589c4d37caff44ddd371e8ca1dcc210b369a (diff)
Never ever use sync as it reduces performance and makes people believe that
it wears out their drives (RH bug #157674) Fixup this a little bit Update the man page to reflect latest changes. Fix a doublefree when acquiring lock (RH bug #158474)
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/locking.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/locking.py b/examples/locking.py
index 4c011337..c70230f6 100755
--- a/examples/locking.py
+++ b/examples/locking.py
@@ -16,12 +16,16 @@ pid = os.getpid()
reason = "locking.py pid %d"%pid
bus = dbus.Bus(dbus.Bus.TYPE_SYSTEM)
-hal_service = bus.get_service("org.freedesktop.Hal")
+
+devobj = bus.get_object("org.freedesktop.Hal", dev_udi)
+dev = dbus.Interface(devobj, "org.freedesktop.Hal.Device")
+#hal_service = bus.get_service("org.freedesktop.Hal")
+#dev = hal_service.get_object (dev_udi, "org.freedesktop.Hal.Device")
+
print "I am %s with pid %d"%(bus.get_connection().get_unique_name(), pid)
print
-dev = hal_service.get_object (dev_udi, "org.freedesktop.Hal.Device")
print "Attempting to lock %s for %d secs"%(dev_udi, duration)
print "with reason '%s'"%reason