From 5976ece759a3e7458b06f9264d89b79a099e4019 Mon Sep 17 00:00:00 2001 From: vl Date: Mon, 8 Nov 2010 11:07:38 +0100 Subject: [PATCH] Added: ignore sigpipe signal generated by libwww --- code/ryzom/client/src/client.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/code/ryzom/client/src/client.cpp b/code/ryzom/client/src/client.cpp index 43ea4408a..86b182228 100644 --- a/code/ryzom/client/src/client.cpp +++ b/code/ryzom/client/src/client.cpp @@ -1,3 +1,4 @@ + // Ryzom - MMORPG Framework // Copyright (C) 2010 Winch Gate Property Limited // @@ -28,6 +29,8 @@ #ifdef NL_OS_WINDOWS #include #include +#else +#include #endif #ifdef NL_OS_MAC @@ -108,6 +111,15 @@ void quitCrashReport () contReset(CrashCounterSock); } +#ifndef NL_OS_WINDOWS +static void sigHandler(int Sig) +{ + // redirect the signal for the next time + signal(Sig, sigHandler); + nlwarning("Ignoring signal SIGPIPE"); +} +#endif + //--------------------------------------------------- // MAIN : // Entry for the Application. @@ -527,6 +539,10 @@ int main(int argc, char **argv) strcpy(filename, argv[0]); + + // ignore signal SIGPIPE generated by libwww + signal(SIGPIPE, sigHandler); + #endif // initialize patch manager and set the ryzom full path, before it's used