From: Wei Liu Date: Mon, 10 Aug 2015 08:00:19 +0000 (+0100) Subject: oxenstored: move sd_notify_ready out of main loop X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~2636 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=18dd9f7fc27fbe3c802c4e8f7e8ac3150eb7d624;p=xen.git oxenstored: move sd_notify_ready out of main loop Oxenstored only needs to notify systemd its readiness state once. Move sd_notify_ready out of main loop. Signed-off-by: Wei Liu Acked-by: Dave Scott Tested-by: Andrew Cooper --- diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml index f4840247b6..42b8183d4d 100644 --- a/tools/ocaml/xenstored/xenstored.ml +++ b/tools/ocaml/xenstored/xenstored.ml @@ -428,11 +428,11 @@ let _ = process_domains store cons domains in + if Systemd.launched_by_systemd () then + Systemd.sd_notify_ready (); while not !quit do try - if Systemd.launched_by_systemd() then - Systemd.sd_notify_ready (); main_loop () with exc -> error "caught exception %s" (Printexc.to_string exc);