From: Jérémie D. <Ba...@us...> - 2010-05-20 19:54:39
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "krobot". The branch, master has been updated via 3203ee03ae548651c179d42d530326159cfa862e (commit) from 4d68c289e5743915edea6f7b24a9a27af6b7dd25 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3203ee03ae548651c179d42d530326159cfa862e Author: Jérémie Dimino <je...@di...> Date: Thu May 20 21:53:04 2010 +0200 request the driver name by hand There is already a mechanism to handle driver restart, no need for Util.single_instance ----------------------------------------------------------------------- Changes: diff --git a/info/control/driver/driver.ml b/info/control/driver/driver.ml index ae34e5b..b3568d0 100644 --- a/info/control/driver/driver.ml +++ b/info/control/driver/driver.ml @@ -1361,13 +1361,8 @@ lwt () = lwt () = try_lwt lwt () = Lwt_log.info ~section "Killing any running driver" in - OBus_proxy.call - (OBus_proxy.make (OBus_peer.make bus "fr.krobot.Driver") ["fr"; "krobot"; "Manager"]) - ~interface:"fr.krobot.Manager" - ~member:"Shutdown" - ~i_args:OBus_value.C.seq0 - ~o_args:OBus_value.C.seq0 - () + let proxy = OBus_proxy.make (OBus_peer.make bus "fr.krobot.Driver") ["fr"; "krobot"; "Manager"] in + OBus_method.call Krobot_interfaces.Fr_krobot_Manager.m_Shutdown proxy () with OBus_error.DBus((OBus_bus.Service_unknown | OBus_error.No_reply), _, _) -> return () in @@ -1376,7 +1371,14 @@ lwt () = return () else begin - lwt () = Util.single_instance bus "fr.krobot.Driver" in + lwt () = + OBus_bus.request_name bus ~allow_replacement:true ~replace_existing:true "fr.krobot.Driver" >>= function + | `Primary_owner -> + return () + | _ -> + lwt () = Lwt_log.info ~section "cannot get the fr.krobot.Driver name, exiting" in + exit 1 + in lwt () = if !foreground then hooks/post-receive -- krobot |