mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
allow usage of error() and killme() without previous call to signals_init()
This commit is contained in:
parent
bbbad2e59b
commit
ec710f8a17
1 changed files with 5 additions and 1 deletions
|
@ -336,7 +336,11 @@ int signals_init(void (*cb)(int signal, siginfo_t *sinfo, void *ctx))
|
|||
|
||||
void killme(int sig)
|
||||
{
|
||||
pthread_kill(main_thread, sig);
|
||||
/* Send only to main thread in case the ID was initilized by signals_init() */
|
||||
if (main_thread)
|
||||
pthread_kill(main_thread, sig);
|
||||
else
|
||||
kill(0, sig);
|
||||
}
|
||||
|
||||
pid_t spawn(const char* name, char *const argv[])
|
||||
|
|
Loading…
Add table
Reference in a new issue