mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 13:43:47 +01:00
Remove the unused is_parent==0 option from handle_signals.
This commit is contained in:
parent
a61c36d53a
commit
fdd5734875
@ -2530,7 +2530,7 @@ do_main_loop(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handle_signals(1);
|
handle_signals();
|
||||||
monotime_init();
|
monotime_init();
|
||||||
timers_initialize();
|
timers_initialize();
|
||||||
|
|
||||||
@ -3052,12 +3052,11 @@ static struct {
|
|||||||
{ -1, -1, NULL }
|
{ -1, -1, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Set up the signal handlers for either parent or child process */
|
/** Set up the signal handlers for this process. */
|
||||||
void
|
void
|
||||||
handle_signals(int is_parent)
|
handle_signals(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
if (is_parent) {
|
|
||||||
for (i = 0; signal_handlers[i].signal_value >= 0; ++i) {
|
for (i = 0; signal_handlers[i].signal_value >= 0; ++i) {
|
||||||
if (signal_handlers[i].try_to_register) {
|
if (signal_handlers[i].try_to_register) {
|
||||||
signal_handlers[i].signal_event =
|
signal_handlers[i].signal_event =
|
||||||
@ -3076,23 +3075,6 @@ handle_signals(int is_parent)
|
|||||||
&signal_handlers[i].signal_value);
|
&signal_handlers[i].signal_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
#ifndef _WIN32
|
|
||||||
struct sigaction action;
|
|
||||||
action.sa_flags = 0;
|
|
||||||
sigemptyset(&action.sa_mask);
|
|
||||||
action.sa_handler = SIG_IGN;
|
|
||||||
sigaction(SIGINT, &action, NULL);
|
|
||||||
sigaction(SIGTERM, &action, NULL);
|
|
||||||
sigaction(SIGPIPE, &action, NULL);
|
|
||||||
sigaction(SIGUSR1, &action, NULL);
|
|
||||||
sigaction(SIGUSR2, &action, NULL);
|
|
||||||
sigaction(SIGHUP, &action, NULL);
|
|
||||||
#ifdef SIGXFSZ
|
|
||||||
sigaction(SIGXFSZ, &action, NULL);
|
|
||||||
#endif
|
|
||||||
#endif /* !defined(_WIN32) */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure the signal handler for signal_num will be called. */
|
/* Make sure the signal handler for signal_num will be called. */
|
||||||
|
@ -66,7 +66,7 @@ MOCK_DECL(long,get_uptime,(void));
|
|||||||
|
|
||||||
unsigned get_signewnym_epoch(void);
|
unsigned get_signewnym_epoch(void);
|
||||||
|
|
||||||
void handle_signals(int is_parent);
|
void handle_signals(void);
|
||||||
void activate_signal(int signal_num);
|
void activate_signal(int signal_num);
|
||||||
|
|
||||||
int try_locking(const or_options_t *options, int err_if_locked);
|
int try_locking(const or_options_t *options, int err_if_locked);
|
||||||
|
Loading…
Reference in New Issue
Block a user