Kevin Ryde wrote:
Dan McMahill <[EMAIL PROTECTED]> writes:

So is there an easy way to detect when the pipe was terminated so I
can avoid crashing?


You can set the SIGPIPE signal to avoid terminating on a broken pipe.
Usually setting it to SIG_IGN is the cleanest, with that a write
throws an EPIPE error.  (Read more in the libc manual.)

As to actually detecting the termination, SIGCHLD might tell you as
soon as the child dies (though you probably have to be careful not to
interfere with the cleanups close-pipe will do).


I tried this:

(sigaction SIGPIPE SIG_IGN)

before

(set! pcb:pipe (open-output-pipe "pcb --listen"))

but when I exit out of pcb, I still get

ERROR: In procedure write_all:
ERROR: Broken pipe

For various reasons I prefer to do whatever magic needs doing to deal with this completely in scheme rather than in the c program which uses guile.

Thanks
-Dan


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

Reply via email to