miragesdk: do not die brutally when the calf terminates

Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
This commit is contained in:
Thomas Gazagnaire
2017-03-30 19:57:36 +02:00
parent 0f0b721b19
commit 6500becfea
2 changed files with 2 additions and 4 deletions

View File

@@ -78,9 +78,7 @@ module Fd = struct
let buf = Bytes.create len in
let rec loop () =
Lwt_unix.read src.fd buf 0 len >>= fun len ->
if len = 0 then
(* FIXME: why this ever happen *)
Fmt.kstrf Lwt.fail_with "FORWARD[%a => %a]: EOF" pp src pp dst
if len = 0 then Lwt.return_unit (* EOF *)
else (
Log.debug (fun l ->
l "FORWARD[%a => %a]: %S (%d)"