diff --git a/modules/juce_core/native/juce_posix_NamedPipe.cpp b/modules/juce_core/native/juce_posix_NamedPipe.cpp index c951974cf5..c97f8815f3 100644 --- a/modules/juce_core/native/juce_posix_NamedPipe.cpp +++ b/modules/juce_core/native/juce_posix_NamedPipe.cpp @@ -37,7 +37,7 @@ public: stopReadOperation (false) { signal (SIGPIPE, signalHandler); - siginterrupt (SIGPIPE, 1); + juce_siginterrupt (SIGPIPE, 1); } ~Pimpl() diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index 42d646f1c0..8db1f521a1 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -179,6 +179,21 @@ bool File::setAsCurrentWorkingDirectory() const return chdir (getFullPathName().toUTF8()) == 0; } +//============================================================================== +// The unix siginterrupt function is deprecated - this does the same job. +int juce_siginterrupt (int sig, int flag) +{ + struct ::sigaction act; + (void) ::sigaction (sig, nullptr, &act); + + if (flag != 0) + act.sa_flags &= ~SA_RESTART; + else + act.sa_flags |= SA_RESTART; + + return ::sigaction (sig, &act, nullptr); +} + //============================================================================== namespace { diff --git a/modules/juce_core/system/juce_SystemStats.cpp b/modules/juce_core/system/juce_SystemStats.cpp index c8313d0d64..50b8ede429 100644 --- a/modules/juce_core/system/juce_SystemStats.cpp +++ b/modules/juce_core/system/juce_SystemStats.cpp @@ -84,7 +84,7 @@ String SystemStats::getStackBacktrace() int frames = (int) CaptureStackBackTrace (0, numElementsInArray (stack), stack, nullptr); HeapBlock symbol; - symbol.calloc (sizeof(SYMBOL_INFO) + 256, 1); + symbol.calloc (sizeof (SYMBOL_INFO) + 256, 1); symbol->MaxNameLen = 255; symbol->SizeOfStruct = sizeof (SYMBOL_INFO); @@ -136,6 +136,8 @@ static void handleCrash (int) globalCrashHandler(); kill (getpid(), SIGKILL); } + +int juce_siginterrupt (int sig, int flag); #endif void SystemStats::setApplicationCrashHandler (CrashHandlerFunction handler) @@ -151,7 +153,7 @@ void SystemStats::setApplicationCrashHandler (CrashHandlerFunction handler) for (int i = 0; i < numElementsInArray (signals); ++i) { ::signal (signals[i], handleCrash); - ::siginterrupt (signals[i], 1); + juce_siginterrupt (signals[i], 1); } #endif }