[Issue 1491] New: if working with timed-out socket, SIGPIPE will kill program
Downs
default_357-line at yahoo.de
Tue Sep 11 21:45:59 PDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Alright, here's a revised version of the patch.
diff config/gen_unix.c.old config/gen_unix.c -u; diff -u
std/socket.d.old std/socket.d
- --- config/gen_unix.c.old 2007-09-12 06:33:55.000000000 +0200
+++ config/gen_unix.c 2007-09-12 06:29:01.000000000 +0200
@@ -667,6 +667,7 @@
CES( MSG_OOB );
CES( MSG_PEEK );
CES( MSG_DONTROUTE );
+ CES( MSG_NOSIGNAL );
printf("}\n");
printf("\n");
}
- --- std/socket.d.old 2007-09-11 03:05:54.000000000 +0200
+++ std/socket.d 2007-09-12 06:37:08.000000000 +0200
@@ -1335,6 +1335,11 @@
//returns number of bytes actually sent, or -1 on error
int send(void[] buf, SocketFlags flags)
{
+ version(Windows) { }
+ else
+ {
+ flags |= MSG_NOSIGNAL;
+ }
int sent = .send(sock, buf.ptr, buf.length, cast(int)flags);
return sent;
}
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG528HpEPJRr05fBERAmUiAJ9ZeCIXYZ9i1nrAzxsu2VaamtoEEQCggw/r
C7/6C3M8RK0c/PTZzH7/dFM=
=ZjqC
-----END PGP SIGNATURE-----
More information about the Digitalmars-d-bugs
mailing list