|
From: Sam S. <sd...@gn...> - 2008-12-29 21:23:37
|
Don Cohen wrote:
> and now on the server I get this
> [3]> (socket:socket-status str)
>
> [../src/stream.d:6143]
> *** - UNIX error 104 (ECONNRESET): Connection reset by peer
> The following restarts are available:
> ABORT :R1 Abort main loop
> Break 1 [4]>
with the appended patch:
[3]> (socket:socket-status str)
:APPEND ;
1
Alas:
[4]> (write-line "foo" str)
Program received signal SIGPIPE, Broken pipe.
0x00000033c82c0e50 in __write_nocancel () from /lib64/libc.so.6
(gdb) up
#1 0x00000000005eacef in fd_write (fd=8, bufarea=0x7fff75f78a60, nbyte=3,
persev=persev_full) at ../src/unixaux.d:462
462 var ssize_t retval = write(fd,buf,nbyte);
the socket appears to be in a totally broken state!
Bruno, why am I getting SIGPIPE instead of a EPIPE?
--- unixaux.d.~1.64.~ 2008-12-05 09:40:57.000000000 -0500
+++ unixaux.d 2008-12-29 16:17:12.000395000 -0500
@@ -319,6 +319,10 @@ global ssize_t fd_read (int fd, void* bu
errno = ENOENT;
break;
} else if (retval < 0) {
+ #ifdef ECONNRESET
+ if (errno == ECONNRESET)
+ { errno = ENOENT; break; }
+ #endif
#ifdef EINTR
if (errno != EINTR)
#endif
|