Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Ocaml 3.06 bug
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] Ocaml 3.06 bug
> There is a bug in the Unix library, which makes my program exit with
> no warning message.
> 
> It happens when I call Unix.write two times on a descriptor closed
> by the other side.

It's not an OCaml bug, it's a Unix feature.  Writes on a socket that
corresponds to a closed connection generates a SIGPIPE signal, whose
default effect is to kill your process.  

There are ways to catch SIGPIPE or to replace it by an error code
generated by Unix.write; please consult a Unix programming guide
(e.g. Steven's books).

- Xavier Leroy
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners