Merge pull request #15467 from unknownbrackets/sigpipe

Net: Ignore SIGPIPE errors on POSIX systems
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2022-04-03 16:42:06 +02:00
commit fbe3fdeda1
6 files changed
+35

No files matched your search

+4
View File
@@ -32,3 +32,7 @@ charset = utf-8
[libretro/**.{cpp,h}]
indent_style = space
indent_size = 3
[SDL/SDLMain.mm]
indent_style = space
indent_size = 4
+6
View File
@@ -48,6 +48,7 @@
#include "Core/ConfigValues.h"
#include "Core/HW/Camera.h"
#include <signal.h>
#include <string.h>
MainUI *emugl = nullptr;
@@ -710,6 +711,11 @@ int main(int argc, char *argv[])
}
}
// Ignore sigpipe.
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
perror("Unable to ignore SIGPIPE");
}
PROFILE_INIT();
glslang::InitializeProcess();
#if defined(Q_OS_LINUX)
+6
View File
@@ -18,6 +18,7 @@ SDLJoystick *joystick = NULL;
#include <atomic>
#include <algorithm>
#include <cmath>
#include <csignal>
#include <thread>
#include <locale>
@@ -519,6 +520,11 @@ int main(int argc, char *argv[]) {
#ifdef HAVE_LIBNX
socketInitializeDefault();
nxlinkStdio();
#else // HAVE_LIBNX
// Ignore sigpipe.
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
perror("Unable to ignore SIGPIPE");
}
#endif // HAVE_LIBNX
PROFILE_INIT();
+6
View File
@@ -8,6 +8,7 @@
#include "SDL.h"
#include "SDLMain.h"
#include "Common/Profiler/Profiler.h"
#include <signal.h>
#include <sys/param.h> /* for MAXPATHLEN */
#include <unistd.h>
@@ -374,6 +375,11 @@ int main (int argc, char **argv)
PROFILE_INIT();
// Ignore sigpipe.
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
perror("Unable to ignore SIGPIPE");
}
#if SDL_USE_NIB_FILE
NSApplicationMain (argc, argv);
#else
+7
View File
@@ -17,6 +17,8 @@
#include "Common/CommonWindows.h"
#if PPSSPP_PLATFORM(WINDOWS)
#include <timeapi.h>
#else
#include <csignal>
#endif
#include "Common/CPUDetect.h"
#include "Common/File/VFS/VFS.h"
@@ -246,6 +248,11 @@ int main(int argc, const char* argv[])
PROFILE_INIT();
#if PPSSPP_PLATFORM(WINDOWS)
timeBeginPeriod(1);
#else
// Ignore sigpipe.
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
perror("Unable to ignore SIGPIPE");
}
#endif
#if defined(_DEBUG) && defined(_MSC_VER)
+6
View File
@@ -4,6 +4,7 @@
#import <dlfcn.h>
#import <mach/mach.h>
#import <pthread.h>
#import <signal.h>
#import <string>
#import <stdio.h>
#import <stdlib.h>
@@ -270,6 +271,11 @@ int main(int argc, char *argv[])
PROFILE_INIT();
// Ignore sigpipe.
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
perror("Unable to ignore SIGPIPE");
}
@autoreleasepool {
return UIApplicationMain(argc, argv, NSStringFromClass([PPSSPPUIApplication class]), NSStringFromClass([AppDelegate class]));
}