small fix

This commit is contained in:
Simon Cruanes 2016-01-25 16:43:45 +01:00
parent 7f42c94df7
commit 32fad92be8

View file

@ -196,11 +196,12 @@ type process_full = <
let with_process_full ?env cmd ~f =
let env = match env with None -> Unix.environment () | Some e -> e in
let oc, ic, err = Unix.open_process_full cmd env in
let close = lazy (Unix.close_process_full (oc,ic,err)) in
let p = object
method stdin = ic
method stdout = oc
method stderr = err
method close = Unix.close_process_full (oc,ic,err)
method close = Lazy.force close
end in
finally_ f p ~h:(fun () -> p#close)