diff options
| author | Mark Stapp <mjs@voltanet.io> | 2020-07-06 12:55:03 -0400 | 
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2020-10-23 08:59:34 -0400 | 
| commit | b3d6bc6ef0140a194b4bc2993a6aba72ab5d54c9 (patch) | |
| tree | b5ef6dcab41d9da516a6ff044056e0faca7b35da /bfdd/control.c | |
| parent | 90a65457d12d8d90bf47eab1a4bb5446b3810d96 (diff) | |
* : update signature of thread_cancel api
Change thread_cancel to take a ** to an event, NULL-check
before dereferencing, and NULL the caller's pointer. Update
many callers to use the new signature.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'bfdd/control.c')
| -rw-r--r-- | bfdd/control.c | 21 | 
1 files changed, 4 insertions, 17 deletions
diff --git a/bfdd/control.c b/bfdd/control.c index 3b954c64f8..4929bf1998 100644 --- a/bfdd/control.c +++ b/bfdd/control.c @@ -145,10 +145,7 @@ void control_shutdown(void)  {  	struct bfd_control_socket *bcs; -	if (bglobal.bg_csockev) { -		thread_cancel(bglobal.bg_csockev); -		bglobal.bg_csockev = NULL; -	} +	thread_cancel(&bglobal.bg_csockev);  	socket_close(&bglobal.bg_csock); @@ -204,15 +201,8 @@ static void control_free(struct bfd_control_socket *bcs)  	struct bfd_control_queue *bcq;  	struct bfd_notify_peer *bnp; -	if (bcs->bcs_ev) { -		thread_cancel(bcs->bcs_ev); -		bcs->bcs_ev = NULL; -	} - -	if (bcs->bcs_outev) { -		thread_cancel(bcs->bcs_outev); -		bcs->bcs_outev = NULL; -	} +	thread_cancel(&(bcs->bcs_ev)); +	thread_cancel(&(bcs->bcs_outev));  	close(bcs->bcs_sd); @@ -318,10 +308,7 @@ static int control_queue_dequeue(struct bfd_control_socket *bcs)  	return 1;  empty_list: -	if (bcs->bcs_outev) { -		thread_cancel(bcs->bcs_outev); -		bcs->bcs_outev = NULL; -	} +	thread_cancel(&(bcs->bcs_outev));  	bcs->bcs_bout = NULL;  	return 0;  }  | 
