diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7922c4425f4..fe8d42d75d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,9 +85,9 @@ jobs: # On top of this it's difficult to make it just run once on CI # without adding changes to more than a single file run: | - ERR=$(egrep 'Error |Warning ' -c make-check.log) + ERR=$(egrep 'Error \(|Warning \(' -c make-check.log) echo ERR=$ERR - test 5 -eq "$ERR" + test 1 -eq "$ERR" - name: Check all code in release mode # This should be removed when the preceding passes succeed diff --git a/ocaml/libs/http-svr/server_io.ml b/ocaml/libs/http-svr/server_io.ml index f1c204bb036..28fd584d1dc 100644 --- a/ocaml/libs/http-svr/server_io.ml +++ b/ocaml/libs/http-svr/server_io.ml @@ -37,33 +37,7 @@ exception PleaseClose let set_intersect a b = List.filter (fun x -> List.mem x b) a -(** Establish a server; handler is either 'by_thread' or 'in_this_thread' *) -type sock_or_addr = - | Server_sockaddr of Unix.sockaddr - | Server_fd of Unix.file_descr - -let establish_server ?(signal_fds = []) forker sockoraddr = - let sock = - match sockoraddr with - | Server_sockaddr sockaddr -> - let domain = - match sockaddr with - | ADDR_UNIX _ -> - debug "Establishing Unix domain server" ; - Unix.PF_UNIX - | ADDR_INET (_, _) -> - debug "Establishing inet domain server" ; - Unix.PF_INET - in - let sock = Unix.socket domain Unix.SOCK_STREAM 0 in - Unix.set_close_on_exec sock ; - Unix.setsockopt sock Unix.SO_REUSEADDR true ; - Unix.bind sock sockaddr ; - Unix.listen sock 5 ; - sock - | Server_fd fd -> - fd - in +let establish_server ?(signal_fds = []) forker sock = while true do try let r, _, _ = Unix.select ([sock] @ signal_fds) [] [] (-1.) in @@ -117,7 +91,7 @@ let server handler sock = try establish_server ~signal_fds:[status_out] (handler_by_thread handler) - (Server_fd sock) + sock with PleaseClose -> debug "Server thread exiting" ) () diff --git a/ocaml/libs/stunnel/stunnel.ml b/ocaml/libs/stunnel/stunnel.ml index 0052e1d7974..062ebe1ba2b 100644 --- a/ocaml/libs/stunnel/stunnel.ml +++ b/ocaml/libs/stunnel/stunnel.ml @@ -92,15 +92,9 @@ module Unsafe = struct (* File descriptor operations to be performed after a fork. * These are all safe in the presence of threads *) - type fd_operation = - | Dup2 of Unix.file_descr * Unix.file_descr - | Close of Unix.file_descr - - let do_fd_operation = function - | Dup2 (a, b) -> - Unix.dup2 a b - | Close a -> - Unix.close a + type fd_operation = Dup2 of Unix.file_descr * Unix.file_descr + + let do_fd_operation = function Dup2 (a, b) -> Unix.dup2 a b end type pid = diff --git a/ocaml/xenopsd/xc/device.ml b/ocaml/xenopsd/xc/device.ml index 889939e66d9..a2e22c7ee2c 100644 --- a/ocaml/xenopsd/xc/device.ml +++ b/ocaml/xenopsd/xc/device.ml @@ -263,7 +263,7 @@ module Generic = struct let is_backend backend_type path = let affix = Printf.sprintf "backend/%s/" backend_type in - Astring.String.is_infix affix path + Astring.String.is_infix ~affix path let is_qdisk_or_9pfs x = let path = Hotplug.path_written_by_hotplug_scripts x in @@ -708,7 +708,7 @@ module Vbd_Common = struct ("physical-device", physical_device) ; ("physical-device-path", physical_device_path) ] - | [vdi; tag; security_model; path] -> + | [_vdi; tag; security_model; path] -> List.iter (fun (k, v) -> Hashtbl.replace back_tbl k v) [("security_model", security_model); ("path", path)] ;