Skip to content

Commit 8435a4e

Browse files
authored
OCaml5: Annotate non-returning functions with types (xapi-project#6081)
These become warnings in ocaml 5.0+
2 parents 8768e7c + 0d26553 commit 8435a4e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ocaml/xapi/xapi.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ let init_args () =
180180
Xapi_globs.xenopsd_queues := ["xenopsd"]
181181
)
182182

183-
let wait_to_die () =
183+
let wait_to_die () : unit =
184184
(* don't call Thread.join cos this interacts strangely with OCAML runtime and stops
185185
the OCAML-level signal handlers ever getting called... Thread.delay is fine tho' *)
186186
while true do

ocaml/xapi/xapi_ha.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ let uuid_of_host_address address =
130130
let on_master_failure () =
131131
(* The plan is: keep asking if I should be the master. If I'm rejected then query the
132132
live set and see if someone else has been marked as master, if so become a slave of them. *)
133-
let become_master () =
133+
let become_master () : unit =
134134
info "This node will become the master" ;
135135
Xapi_pool_transition.become_master () ;
136136
info "Waiting for server restart" ;

ocaml/xenopsd/cli/xn.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ let unix_proxy path =
10511051
| 0 ->
10521052
let buf = Bytes.make 16384 '\000' in
10531053
let accept, _ = Unix.accept listen in
1054-
let copy a b =
1054+
let copy a b : unit =
10551055
while true do
10561056
let n = Unix.read a buf 0 (Bytes.length buf) in
10571057
if n = 0 then exit 0 ;

0 commit comments

Comments
 (0)