aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/system.ml10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/system.ml b/lib/system.ml
index 237c9848fd..241477e8c4 100644
--- a/lib/system.ml
+++ b/lib/system.ml
@@ -196,18 +196,16 @@ let connect writefun readfun com =
with Sys_error s ->
close_out ch_to_out; close_in ch_to_in;
error ("Cannot set connection from "^com^"("^s^")") in
+ writefun ch_to_out;
+ close_out ch_to_out;
let pid =
let ch_to' = Unix.descr_of_in_channel ch_to_in in
let ch_from' = Unix.descr_of_out_channel ch_from_out in
try Unix.create_process com [||] ch_to' ch_from' Unix.stdout
with Unix.Unix_error (err,_,_) ->
- close_in ch_to_in;
- close_out ch_to_out;
- close_in ch_from_in;
- close_out ch_from_out;
+ close_in ch_to_in; close_in ch_from_in; close_out ch_from_out;
+ unlink tmp_from; unlink tmp_to;
error ("Cannot execute "^com^"("^(Unix.error_message err)^")") in
- writefun ch_to_out;
- close_out ch_to_out;
close_in ch_to_in;
close_out ch_from_out;
(match snd (Unix.waitpid [] pid) with