saturn: Provide more dbus constant names
Makes reading the code easier^W possible.
This commit is contained in:
parent
c4af9e0599
commit
6a5f2ecb18
@ -25,12 +25,17 @@
|
||||
|
||||
|
||||
(local DBUS_NAME_FLAG_DO_NOT_QUEUE 4)
|
||||
(local DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1)
|
||||
(local DBUS_REQUEST_NAME_REPLY_IN_QUEUE 2)
|
||||
(local DBUS_REQUEST_NAME_REPLY_EXISTS 3)
|
||||
(local DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER 4)
|
||||
|
||||
(let [ret (bus:RequestName "net.telent.saturn" DBUS_NAME_FLAG_DO_NOT_QUEUE)]
|
||||
(if (or (= ret 1) (= ret 4))
|
||||
(if (or (= ret DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) (= ret DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER))
|
||||
true
|
||||
(= ret 2)
|
||||
(= ret DBUS_REQUEST_NAME_REPLY_IN_QUEUE)
|
||||
(error "unexpected DBUS_REQUEST_NAME_REPLY_IN_QUEUE")
|
||||
(= ret 3)
|
||||
(= ret DBUS_REQUEST_NAME_REPLY_EXISTS)
|
||||
(do
|
||||
(print "already running")
|
||||
(os.exit 0))))
|
||||
|
Loading…
Reference in New Issue
Block a user