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

@ -19,7 +19,7 @@ system:
command: [/usr/bin/binfmt, -dir, /etc/binfmt.d/, -mount, /binfmt_misc]
- name: dhcp-client
network_mode: host
image: "mobylinux/dhcp-client:da4e4b37ecd11ce411b0b45bde988281c2b35e3a"
image: "mobylinux/dhcp-client:aaf811d77ff8d8b2e16ca4dd9d0a2849ef8977b6"
capabilities:
- CAP_NET_ADMIN # to bring eth0 up
- CAP_NET_RAW # to read /dev/eth0

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)"