Working on bug 184993: Writing to zombie process causes Ikarus to exit.

This commit is contained in:
Abdulaziz Ghuloum 2008-01-21 23:29:04 -05:00
parent b00e56face
commit 264c58c4a4
4 changed files with 16 additions and 2 deletions

View File

@ -1172,7 +1172,8 @@
#| 18 |# "access fault"
#| 19 |# "file already exists"
#| 20 |# "invalid file name"
#| 21 |# "non-blocking operation would block"))
#| 21 |# "non-blocking operation would block"
#| 22 |# "broken pipe (e.g., writing to a closed process or socket)"))
(define (io-error who id err)
(let ([err (fxnot err)])

View File

@ -1 +1 @@
1358
1359

View File

@ -34,6 +34,7 @@ ikrt_io_error(){
case EEXIST : return fix(-20);
case EINVAL : return fix(-21);
case EAGAIN : return fix(-22); /* hardcoded in ikarus.io.ss */
case EPIPE : return fix(-23);
}
return fix(-1);
}

View File

@ -237,6 +237,18 @@ register_handlers(){
fprintf(stderr, "Sigaction Failed: %s\n", strerror(errno));
exit(-1);
}
/* ignore sigpipes */
{
sigset_t set;
sigprocmask(0, 0, &set); /* get the set */
sigaddset(&set, SIGPIPE);
int err = sigprocmask(SIG_SETMASK, &set, &set);
if(err){
fprintf(stderr, "Sigprocmask Failed: %s\n", strerror(errno));
exit(-1);
}
}
}