From 9f80503e9e970ba828bc347d13eaad9e3c36b8f5 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 17 Feb 2022 19:10:18 +0100 Subject: ipcpd: Remove unused wait_state function Probably a leftover from previous shutdown logic. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/ipcp.c | 31 ------------------------------- src/ipcpd/ipcp.h | 3 --- 2 files changed, 34 deletions(-) diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index cd09a7cf..12caac17 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -954,37 +954,6 @@ enum ipcp_state ipcp_get_state() return state; } -int ipcp_wait_state(enum ipcp_state state, - const struct timespec * timeout) -{ - struct timespec abstime; - int ret = 0; - - clock_gettime(PTHREAD_COND_CLOCK, &abstime); - ts_add(&abstime, timeout, &abstime); - - pthread_mutex_lock(&ipcpi.state_mtx); - - pthread_cleanup_push(__cleanup_mutex_unlock, &ipcpi.state_mtx); - - while (ipcpi.state != state - && ipcpi.state != IPCP_SHUTDOWN - && ipcpi.state != IPCP_NULL - && ret != -ETIMEDOUT) { - if (timeout == NULL) - ret = -pthread_cond_wait(&ipcpi.state_cond, - &ipcpi.state_mtx); - else - ret = -pthread_cond_timedwait(&ipcpi.state_cond, - &ipcpi.state_mtx, - &abstime); - } - - pthread_cleanup_pop(true); - - return ret; -} - void ipcp_lock_to_core(void) { #if defined(__linux__) && !defined(DISABLE_CORE_LOCK) diff --git a/src/ipcpd/ipcp.h b/src/ipcpd/ipcp.h index eff2ae12..def65dd2 100644 --- a/src/ipcpd/ipcp.h +++ b/src/ipcpd/ipcp.h @@ -130,9 +130,6 @@ void ipcp_set_state(enum ipcp_state state); enum ipcp_state ipcp_get_state(void); -int ipcp_wait_state(enum ipcp_state state, - const struct timespec * timeout); - int ipcp_parse_arg(int argc, char * argv[]); -- cgit v1.2.3