This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bug somewhere in signals/sockets code


| I'm pretty sure that *this* shouldn't be that way...
| 
| guile> (define sock (socket AF_INET SOCK_STREAM 0))
| guile> (bind sock AF_INET INADDR_ANY 2000)
| guile> (listen sock 8)
| ;; now, in another console, connect to the socket, and close the
| connection
| ;; at once. (or do it in guile...)
| ;; problem described in UNP p.XXX
| guile> (define sock2 (car (accept sock)))
| guile> (display "foo" sock2)
| guile> (display "foo" sock2)
| Broken pipe
| forcer@geniry:~$
| 
| Sadly, i'm not home much, so i can't look into this myself :(
| Have fun bughunting,

I guess we could add:

(sigaction SIGPIPE SIG_IGN)

somewhere.  Then system calls that fail in this way will lead to
Guile exceptions instead of fatal signals.

Asynchronous SIGPIPEs will be ignored completely, but I don't think that's
a problem, I think the only way to get one is with kill.