If HAVE_MSG_NOSIGNAL is set, we use MSG_NOSIGNAL when we call send() and

recv() and we no longer attempt to ignore the SIGPIPE signal.
This commit is contained in:
Daniel Stenberg
2003-12-02 10:12:44 +00:00
parent 909887f310
commit 2cf209d3f7
2 changed files with 19 additions and 10 deletions

View File

@@ -1457,7 +1457,7 @@ CURLcode Curl_pretransfer(struct SessionHandle *data)
* different ports! */
data->state.allow_port = TRUE;
#if defined(HAVE_SIGNAL) && defined(SIGPIPE)
#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(HAVE_MSG_NOSIGNAL)
/*************************************************************
* Tell signal handler to ignore SIGPIPE
*************************************************************/
@@ -1473,7 +1473,7 @@ CURLcode Curl_pretransfer(struct SessionHandle *data)
CURLcode Curl_posttransfer(struct SessionHandle *data)
{
#if defined(HAVE_SIGNAL) && defined(SIGPIPE)
#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(HAVE_MSG_NOSIGNAL)
/* restore the signal handler for SIGPIPE before we get back */
if(!data->set.no_signal)
signal(SIGPIPE, data->state.prev_signal);