close dans establish_server (PR#3794)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7071 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 2005-09-24 08:43:12 +00:00
parent a373f34b2a
commit 1a6304bd80
1 changed files with 3 additions and 4 deletions

View File

@ -928,10 +928,9 @@ let establish_server server_fun sockaddr =
let inchan = in_channel_of_descr s in
let outchan = out_channel_of_descr s in
server_fun inchan outchan;
close_out outchan;
(* The file descriptor was already closed by close_out.
close_in inchan;
*)
(* Do not close inchan nor outchan, as the server_fun could
have done it already, and we are about to exit anyway
(PR#3794) *)
exit 0
| id -> close s; ignore(waitpid [] id) (* Reclaim the son *)
done