mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 19:25:28 -05:00
small fix
This commit is contained in:
parent
7f42c94df7
commit
32fad92be8
1 changed files with 2 additions and 1 deletions
|
|
@ -196,11 +196,12 @@ type process_full = <
|
||||||
let with_process_full ?env cmd ~f =
|
let with_process_full ?env cmd ~f =
|
||||||
let env = match env with None -> Unix.environment () | Some e -> e in
|
let env = match env with None -> Unix.environment () | Some e -> e in
|
||||||
let oc, ic, err = Unix.open_process_full cmd env 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
|
let p = object
|
||||||
method stdin = ic
|
method stdin = ic
|
||||||
method stdout = oc
|
method stdout = oc
|
||||||
method stderr = err
|
method stderr = err
|
||||||
method close = Unix.close_process_full (oc,ic,err)
|
method close = Lazy.force close
|
||||||
end in
|
end in
|
||||||
finally_ f p ~h:(fun () -> p#close)
|
finally_ f p ~h:(fun () -> p#close)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue