Browse Source

Don't use sa_restorer for signal handler, init with memset instead

It's not available on all OSes, and it's better to initialize the
struct with memset anyway
pull/17/head
falkTX 7 years ago
parent
commit
ebb4c82c90
1 changed files with 8 additions and 14 deletions
  1. +8
    -14
      distrho/src/DistrhoPluginJack.cpp

+ 8
- 14
distrho/src/DistrhoPluginJack.cpp View File

@@ -70,20 +70,14 @@ static void closeSignalHandler(int) noexcept

static void initSignalHandler()
{
struct sigaction sint;
struct sigaction sterm;

sint.sa_handler = closeSignalHandler;
sint.sa_flags = SA_RESTART;
sint.sa_restorer = nullptr;
sigemptyset(&sint.sa_mask);
sigaction(SIGINT, &sint, nullptr);

sterm.sa_handler = closeSignalHandler;
sterm.sa_flags = SA_RESTART;
sterm.sa_restorer = nullptr;
sigemptyset(&sterm.sa_mask);
sigaction(SIGTERM, &sterm, nullptr);
struct sigaction sig;
memset(&sig, 0, sizeof(sig));

sig.sa_handler = closeSignalHandler;
sig.sa_flags = SA_RESTART;
sigemptyset(&sig.sa_mask);
sigaction(SIGINT, &sig, nullptr);
sigaction(SIGTERM, &sig, nullptr);
}
#endif



Loading…
Cancel
Save