diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2022-02-17 19:10:18 +0100 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2022-02-18 08:43:14 +0100 |
commit | 9f80503e9e970ba828bc347d13eaad9e3c36b8f5 (patch) | |
tree | 3c5b63cbbd6a12cb3074f06a7b9fd90e0634c7d6 | |
parent | 9277021361a82617b595052ef3bdaf368981f1d8 (diff) | |
download | ouroboros-9f80503e9e970ba828bc347d13eaad9e3c36b8f5.tar.gz ouroboros-9f80503e9e970ba828bc347d13eaad9e3c36b8f5.zip |
ipcpd: Remove unused wait_state function
Probably a leftover from previous shutdown logic.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
-rw-r--r-- | src/ipcpd/ipcp.c | 31 | ||||
-rw-r--r-- | src/ipcpd/ipcp.h | 3 |
2 files changed, 0 insertions, 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[]); |