diff --git a/lib/btrfs_store.ml b/lib/btrfs_store.ml index 4d0b20ce..41e38c72 100644 --- a/lib/btrfs_store.ml +++ b/lib/btrfs_store.ml @@ -90,11 +90,8 @@ let check_kernel_version () = | Some maj, Some min when (maj, min) >= (5, 8) -> Lwt.return_unit | Some maj, Some min -> - Lwt.fail_with - (Fmt.str - "You need at least linux 5.8 to use the btrfs backend, \ - but current kernel version is '%d.%d'" - maj min) + Fmt.failwith "You need at least linux 5.8 to use the btrfs backend, \ + but current kernel version is '%d.%d'" maj min | _, _ -> Fmt.failwith "Could not parse kernel version %S" kver end diff --git a/lib/os.ml b/lib/os.ml index 17801c37..5f4c7195 100644 --- a/lib/os.ml +++ b/lib/os.ml @@ -105,8 +105,8 @@ let exec ?timeout ?cwd ?stdin ?stdout ?stderr ?(is_success=((=) 0)) ?(cmd="") ar let pp f = pp_cmd f (cmd, argv) in !lwt_process_exec ?timeout ?cwd ?stdin ?stdout ?stderr ~pp (cmd, Array.of_list argv) >>= function | Ok n when is_success n -> Lwt.return_unit - | Ok n -> Lwt.fail_with (Fmt.str "%t failed with exit status %d" pp n) - | Error (`Msg m) -> Lwt.fail (Failure m) + | Ok n -> Fmt.failwith "%t failed with exit status %d" pp n + | Error (`Msg m) -> failwith m let running_as_root = not (Sys.unix) || Unix.getuid () = 0 @@ -205,7 +205,7 @@ let pread_all ?stdin ~pp ?(cmd="") argv = >>= fun (stdin, stdout) -> child >>= function | Ok i -> Lwt.return (i, stdin, stdout) - | Error (`Msg m) -> Lwt.fail (Failure m) + | Error (`Msg m) -> failwith m let check_dir x = match Unix.lstat x with @@ -300,4 +300,3 @@ let read_lines name process = | Some s -> loop ((process s) :: acc) | None -> close_in ic; acc in loop [] -