Skip to content

Commit

Permalink
curl: ignore SIGPIPE
Browse files Browse the repository at this point in the history
This is a work-around for bug #1180 which is really libcurl's inability
to ignore SIGPIPE in a few cases. With this work-around at least curl
won't suffer from it!

Bug: http://curl.haxx.se/bug/view.cgi?id=1180
Reported by: Lluís Batlle i Rossell
  • Loading branch information
bagder committed Jan 8, 2013
1 parent fea3a3d commit e2bcd2a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/tool_main.c
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
Expand All @@ -23,6 +23,10 @@

#include <sys/stat.h>

#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif

#define ENABLE_CURLX_PRINTF
/* use our own printf() functions */
#include "curlx.h"
Expand Down Expand Up @@ -83,6 +87,10 @@ int main(int argc, char *argv[])

main_checkfds();

#ifdef HAVE_SIGNAL
signal(SIGPIPE, SIG_IGN);
#endif

res = operate(&config, argc, argv);

#ifdef __SYMBIAN32__
Expand Down

0 comments on commit e2bcd2a

Please sign in to comment.