diff --git a/daemon/chroot.ml b/daemon/chroot.ml index 5e856c91f..7da8ae29e 100644 --- a/daemon/chroot.ml +++ b/daemon/chroot.ml @@ -62,6 +62,10 @@ let f t func arg = (* Parent. *) close wfd; + let chan = in_channel_of_descr rfd in + let ret = input_value chan in + close_in chan; + let _, status = waitpid [] pid in (match status with | WEXITED 0 -> () @@ -76,10 +80,6 @@ let f t func arg = failwithf "chroot ā€˜%s’ stopped by signal %d" t.name i ); - let chan = in_channel_of_descr rfd in - let ret = input_value chan in - close_in chan; - match ret with | Either ret -> ret | Or exn -> raise exn