linux signal

This commit is contained in:
2022-11-01 09:38:27 +03:00
parent 591c92b4bb
commit e48d0ebaab
4 changed files with 10 additions and 5 deletions

View File

@@ -248,6 +248,10 @@
typedef long time_t;
#endif
#ifdef POSIX_SIGNALS
# define PIP_INTERRUPT_SIGNAL SIGTERM
#endif
#ifdef LINUX
# define environ __environ
#endif

View File

@@ -104,7 +104,8 @@ void pipInitThreadSignals() {
sigemptyset(&actions.sa_mask);
actions.sa_flags = 0;
actions.sa_handler = pipThreadSignalHandler;
sigaction(SIGUSR2, &actions, 0);
if (sigaction(PIP_INTERRUPT_SIGNAL, &actions, 0) != 0)
piCout << "sigaction error:" << errorString();
}
#endif

View File

@@ -608,7 +608,7 @@ void PIThread::interrupt() {
QueueUserAPC(winThreadAPC, PRIVATE->thread, 0);
#else
# ifdef POSIX_SIGNALS
pthread_kill(PRIVATE->thread, SIGUSR2);
pthread_kill(PRIVATE->thread, PIP_INTERRUPT_SIGNAL);
# endif
#endif
}