diff --git a/bin/ir_cli.ml b/bin/ir_cli.ml index cb98c63862..07e2de46c0 100644 --- a/bin/ir_cli.ml +++ b/bin/ir_cli.ml @@ -86,7 +86,7 @@ let depth = Arg.(value & opt (some int) None & doc) let run t = - Lwt_unix.run ( + Lwt_main.run ( catch (fun () -> t) (function e -> eprintf "%s\n%!" (Printexc.to_string e); exit 1) diff --git a/examples/custom_merge.ml b/examples/custom_merge.ml index aef3fa6118..847ad4cae3 100644 --- a/examples/custom_merge.ml +++ b/examples/custom_merge.ml @@ -208,4 +208,4 @@ let main () = print_logs "merge" t let () = - Lwt_unix.run (main ()) + Lwt_main.run (main ()) diff --git a/examples/deploy.ml b/examples/deploy.ml index 827224c77d..069744ad0a 100644 --- a/examples/deploy.ml +++ b/examples/deploy.ml @@ -109,24 +109,24 @@ let () = else match Sys.argv.(1) with | "provision" -> - Lwt_unix.run (Store.Repo.create config >>= provision); + Lwt_main.run (Store.Repo.create config >>= provision); Printf.printf "The VM is now provisioned. Run `%s configure` to simulate a sysadmin \n\ configuration.\n" cmd | "configure" -> - Lwt_unix.run (Store.Repo.create config >>= configure); + Lwt_main.run (Store.Repo.create config >>= configure); Printf.printf "The VM is now configured. Run `%s attack` to simulate an attack by an \n\ intruder.\n" cmd | "attack" -> - Lwt_unix.run (Store.Repo.create config >>= attack); + Lwt_main.run (Store.Repo.create config >>= attack); Printf.printf "The VM has been attacked. Run `%s revert` to revert the VM state to a \ safe one.\n" cmd | "revert" -> - Lwt_unix.run (Store.Repo.create config >>= revert) + Lwt_main.run (Store.Repo.create config >>= revert) | _ -> help () diff --git a/examples/git_store.ml b/examples/git_store.ml index eb76a06c83..7db4dad80d 100644 --- a/examples/git_store.ml +++ b/examples/git_store.ml @@ -44,6 +44,6 @@ let () = "This example creates a Git repository in %s and use it to read \n\ and write data:\n" Config.root; let _ = Sys.command (Printf.sprintf "rm -rf %s" Config.root) in - Lwt_unix.run (main ()); + Lwt_main.run (main ()); Printf.printf "You can now run `cd %s && tig` to inspect the store.\n" Config.root; diff --git a/examples/process.ml b/examples/process.ml index c0fea1f5b0..a9276cdef9 100644 --- a/examples/process.ml +++ b/examples/process.ml @@ -142,4 +142,4 @@ let () = init () >>= fun () -> Lwt.join (watchdog () :: List.map (protect process) (Array.to_list images)) in - Lwt_unix.run (aux ()) + Lwt_main.run (aux ()) diff --git a/examples/views.ml b/examples/views.ml index 241d1897c4..b3d6ac28d6 100644 --- a/examples/views.ml +++ b/examples/views.ml @@ -65,4 +65,4 @@ let main () = return_unit let () = - Lwt_unix.run (main ()) + Lwt_main.run (main ()) diff --git a/lib/irmin.mli b/lib/irmin.mli index 376897f38f..8813c8cc20 100644 --- a/lib/irmin.mli +++ b/lib/irmin.mli @@ -2006,7 +2006,7 @@ let () = ) fmt let () = - Lwt_unix.run begin + Lwt_main.run begin S.Repo.create config >>= S.master task >>= fun t -> log t "Adding a new log entry" >>= fun () -> Irmin.clone_force task (t "Cloning the store") "x" diff --git a/lib_test/test_store.ml b/lib_test/test_store.ml index 088df07ead..b374684f62 100644 --- a/lib_test/test_store.ml +++ b/lib_test/test_store.ml @@ -113,9 +113,9 @@ module Make (S: Test_S) = struct History.create (h repo) ~node:kn3 ~parents:[kr1] ~task:Irmin.Task.empty let run x test = - try Lwt_unix.run (x.init () >>= fun () -> S.Repo.create x.config >>= fun repo -> test repo >>= x.clean) + try Lwt_main.run (x.init () >>= fun () -> S.Repo.create x.config >>= fun repo -> test repo >>= x.clean) with e -> - Lwt_unix.run (x.clean ()); + Lwt_main.run (x.clean ()); raise e let random_value x value =