summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1995-09-14 11:53:33 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1995-09-14 11:53:33 +0000
commitb3013090a6c69ffba353945fa73c322357795244 (patch)
treec640581a0425ac720c63d4cb80ba027a1cf3975c /otherlibs/unix
parentd2f75f7f8b9ca50c8746376fbd67d48c6c483ce5 (diff)
Dans open_process_{in,out}, fermer les extremites du pipe inutilisees
par le pere, afin de detecter la fin de fichier correctement. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@273 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/unix')
-rw-r--r--otherlibs/unix/unix.ml8
1 files changed, 6 insertions, 2 deletions
diff --git a/otherlibs/unix/unix.ml b/otherlibs/unix/unix.ml
index 9440f79a1..2ca2de59e 100644
--- a/otherlibs/unix/unix.ml
+++ b/otherlibs/unix/unix.ml
@@ -482,12 +482,16 @@ let open_proc cmd proc input output =
let open_process_in cmd =
let (in_read, in_write) = pipe() in
let inchan = in_channel_of_descr in_read in
- open_proc cmd (Process_in inchan) stdin in_write; inchan
+ open_proc cmd (Process_in inchan) stdin in_write;
+ close in_write;
+ inchan
let open_process_out cmd =
let (out_read, out_write) = pipe() in
let outchan = out_channel_of_descr out_write in
- open_proc cmd (Process_out outchan) out_read stdout; outchan
+ open_proc cmd (Process_out outchan) out_read stdout;
+ close out_read;
+ outchan
let open_process cmd =
let (in_read, in_write) = pipe() in