diff options
author | Steven Barth <steven@midlink.org> | 2014-10-08 11:57:07 +0200 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2014-10-08 11:57:07 +0200 |
commit | 6373af63310f32e1408a81f4e4e069a5f0d3e59e (patch) | |
tree | ebb228f245de9c341acd785f8f82cdfc181e36bf /src/script.c | |
parent | d6fe99f6d03873e7a670c9b6f26fa03b219422f5 (diff) | |
download | odhcp6c-6373af63310f32e1408a81f4e4e069a5f0d3e59e.tar.gz |
Ensure signal-safety of signal handlers
Diffstat (limited to 'src/script.c')
-rw-r--r-- | src/script.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/script.c b/src/script.c index e389cc9..644f61f 100644 --- a/src/script.c +++ b/src/script.c @@ -41,8 +41,6 @@ static const int8_t hexvals[] = { static char *argv[4] = {NULL, NULL, NULL, NULL}; -static volatile char *delayed_call = NULL; -static bool dont_delay = false; int script_init(const char *path, const char *ifname) @@ -332,25 +330,6 @@ static void s46_to_env(enum odhcp6c_state state, const uint8_t *data, size_t len } -static void script_call_delayed(int signal __attribute__((unused))) -{ - if (delayed_call) - script_call((char*)delayed_call); -} - - -void script_delay_call(const char *status, int timeout) -{ - if (dont_delay) { - script_call(status); - } else if (!delayed_call) { - delayed_call = strdup(status); - signal(SIGALRM, script_call_delayed); - alarm(timeout); - } -} - - void script_call(const char *status) { size_t dns_len, search_len, custom_len, sntp_ip_len, ntp_ip_len, ntp_dns_len; @@ -358,10 +337,6 @@ void script_call(const char *status) size_t s46_mapt_len, s46_mape_len, s46_lw_len, passthru_len; odhcp6c_expire(); - if (delayed_call) { - alarm(0); - dont_delay = true; - } struct in6_addr *addr = odhcp6c_get_state(STATE_SERVER_ADDR, &addr_len); struct in6_addr *dns = odhcp6c_get_state(STATE_DNS, &dns_len); |