diff --git a/src/OrcaSlicer.cpp b/src/OrcaSlicer.cpp index 880eaffa4b..7107e1ba1e 100644 --- a/src/OrcaSlicer.cpp +++ b/src/OrcaSlicer.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #if defined(__linux__) || defined(__LINUX__) #include @@ -7459,6 +7460,13 @@ extern "C" { #else /* _MSC_VER */ int main(int argc, char **argv) { +#ifndef _WIN32 + // Ignore SIGPIPE so a write to a closed socket (e.g. a dropped printer + // network connection) returns EPIPE to the caller instead of terminating + // the whole process. Without this, losing the printer link kills + // OrcaSlicer with SIGPIPE (exit 141) and produces no crash report. + std::signal(SIGPIPE, SIG_IGN); +#endif return CLI().run(argc, argv); } #endif /* _MSC_VER */