From 0d265537c3d363b3f3b188ca3d98ca5a411e0100 Mon Sep 17 00:00:00 2001 From: Pau Ruiz Safont Date: Tue, 22 Oct 2024 16:55:25 +0100 Subject: [PATCH] chore: annotate types for non-returning functions These become warnings in ocaml 5.0+ Signed-off-by: Pau Ruiz Safont --- ocaml/xapi/xapi.ml | 2 +- ocaml/xapi/xapi_ha.ml | 2 +- ocaml/xenopsd/cli/xn.ml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ocaml/xapi/xapi.ml b/ocaml/xapi/xapi.ml index ed6323663e3..ca87e740efb 100644 --- a/ocaml/xapi/xapi.ml +++ b/ocaml/xapi/xapi.ml @@ -180,7 +180,7 @@ let init_args () = Xapi_globs.xenopsd_queues := ["xenopsd"] ) -let wait_to_die () = +let wait_to_die () : unit = (* don't call Thread.join cos this interacts strangely with OCAML runtime and stops the OCAML-level signal handlers ever getting called... Thread.delay is fine tho' *) while true do diff --git a/ocaml/xapi/xapi_ha.ml b/ocaml/xapi/xapi_ha.ml index ddfbc357fb2..b6ba195f823 100644 --- a/ocaml/xapi/xapi_ha.ml +++ b/ocaml/xapi/xapi_ha.ml @@ -130,7 +130,7 @@ let uuid_of_host_address address = let on_master_failure () = (* The plan is: keep asking if I should be the master. If I'm rejected then query the live set and see if someone else has been marked as master, if so become a slave of them. *) - let become_master () = + let become_master () : unit = info "This node will become the master" ; Xapi_pool_transition.become_master () ; info "Waiting for server restart" ; diff --git a/ocaml/xenopsd/cli/xn.ml b/ocaml/xenopsd/cli/xn.ml index 4c1251cccbd..a6ed6a884bd 100644 --- a/ocaml/xenopsd/cli/xn.ml +++ b/ocaml/xenopsd/cli/xn.ml @@ -1051,7 +1051,7 @@ let unix_proxy path = | 0 -> let buf = Bytes.make 16384 '\000' in let accept, _ = Unix.accept listen in - let copy a b = + let copy a b : unit = while true do let n = Unix.read a buf 0 (Bytes.length buf) in if n = 0 then exit 0 ;