mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
catch signals in a more portable way, so solaris can catch them too
svn:r1324
This commit is contained in:
parent
e9b67e1e6a
commit
3d2c6c7cfa
@ -738,12 +738,19 @@ int tor_main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MS_WINDOWS /* do signal stuff only on unix */
|
#ifndef MS_WINDOWS /* do signal stuff only on unix */
|
||||||
signal (SIGINT, catch); /* catch kills so we can exit cleanly */
|
{
|
||||||
signal (SIGTERM, catch);
|
struct sigaction action;
|
||||||
signal (SIGPIPE, catch);
|
action.sa_flags = 0;
|
||||||
signal (SIGUSR1, catch); /* to dump stats */
|
sigemptyset(&action.sa_mask);
|
||||||
signal (SIGHUP, catch); /* to reload directory */
|
|
||||||
signal (SIGCHLD, catch); /* for exiting dns/cpu workers */
|
action.sa_handler = catch;
|
||||||
|
sigaction(SIGINT, &action, NULL);
|
||||||
|
sigaction(SIGTERM, &action, NULL);
|
||||||
|
sigaction(SIGPIPE, &action, NULL);
|
||||||
|
sigaction(SIGUSR1, &action, NULL);
|
||||||
|
sigaction(SIGHUP, &action, NULL); /* to reload config, retry conns, etc */
|
||||||
|
sigaction(SIGCHLD, &action, NULL); /* handle dns/cpu workers that exit */
|
||||||
|
}
|
||||||
#endif /* signal stuff */
|
#endif /* signal stuff */
|
||||||
|
|
||||||
crypto_global_init();
|
crypto_global_init();
|
||||||
|
Loading…
Reference in New Issue
Block a user