diff options
author | Daniel Stenberg <daniel@haxx.se> | 2013-01-08 23:10:26 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2013-01-08 23:14:01 +0100 |
commit | e2bcd2ab9e5ad894a57756fa660d2a07b69171f4 (patch) | |
tree | 15b64f6174e2975047dedd555efb7b9d18414683 | |
parent | fea3a3d5695d9201e602a329dffb0c1acad386b8 (diff) | |
download | curl-e2bcd2ab9e5ad894a57756fa660d2a07b69171f4.tar.gz |
curl: ignore SIGPIPE
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
-rw-r--r-- | src/tool_main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tool_main.c b/src/tool_main.c index 9c0a19f3f..ec6517650 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -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 @@ -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" @@ -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__ |