diff options
Diffstat (limited to 'src/microhttpd/mhd_sockets.h')
-rw-r--r-- | src/microhttpd/mhd_sockets.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/microhttpd/mhd_sockets.h b/src/microhttpd/mhd_sockets.h index 6fefd7d4..d160dbcd 100644 --- a/src/microhttpd/mhd_sockets.h +++ b/src/microhttpd/mhd_sockets.h | |||
@@ -702,6 +702,18 @@ int | |||
702 | MHD_socket_noninheritable_ (MHD_socket sock); | 702 | MHD_socket_noninheritable_ (MHD_socket sock); |
703 | 703 | ||
704 | 704 | ||
705 | #if defined(SOL_SOCKET) && defined(SO_NOSIGPIPE) | ||
706 | static const int _MHD_socket_int_one = 1; | ||
707 | /** | ||
708 | * Change socket options to no signal on remote disconnect. | ||
709 | * | ||
710 | * @param sock socket to manipulate | ||
711 | * @return non-zero if succeeded, zero otherwise | ||
712 | */ | ||
713 | # define MHD_socket_nosignal_(sock) \ | ||
714 | (!setsockopt((sock),SOL_SOCKET,SO_NOSIGPIPE,&_MHD_socket_int_one,sizeof(_MHD_socket_int_one))) | ||
715 | #endif /* SOL_SOCKET && SO_NOSIGPIPE */ | ||
716 | |||
705 | /** | 717 | /** |
706 | * Create a listen socket, with noninheritable flag if possible. | 718 | * Create a listen socket, with noninheritable flag if possible. |
707 | * | 719 | * |