From 222fe5b983aa951cd867041ad77526ffad1eb3ef Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 24 Feb 2019 09:33:18 +1100 Subject: [PATCH] Fix crash from SIGPIPE when disconnected from a server --- src/Platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Platform.c b/src/Platform.c index 47e8d76bf..7825ac717 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -2153,6 +2153,8 @@ int Platform_ConvertString(void* data, const String* src) { static void Platform_InitCommon(void) { signal(SIGCHLD, SIG_IGN); + /* So writing to closed socket doesn't raise SIGPIPE */ + signal(SIGPIPE, SIG_IGN); Platform_InitDisplay(); pthread_mutex_init(&audio_lock, NULL); }