diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-05-05 21:22:25 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-05-09 20:44:22 +0000 |
| commit | 66e78ae64bc4659848517953b365606e3e70e878 (patch) | |
| tree | ef1339e397feed2b56b8d653d41c03aa5b2bd94f /pimd/pim_msdp_socket.c | |
| parent | 32d86f8b7a327cfc6904d51d5c3ea8f5c6115e44 (diff) | |
*: update thread_add_* calls
Pass pointer to pointer instead of assigning by return value. See
previous commit message.
To ensure that the behavior stays functionally correct, any assignments
with the result of a thread_add* function have been transformed to set
the pointer to null before passing it. These can be removed wherever the
pointer is known to already be null.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_msdp_socket.c')
| -rw-r--r-- | pimd/pim_msdp_socket.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pimd/pim_msdp_socket.c b/pimd/pim_msdp_socket.c index b09dd635a0..8ceddfa39d 100644 --- a/pimd/pim_msdp_socket.c +++ b/pimd/pim_msdp_socket.c @@ -70,8 +70,9 @@ pim_msdp_sock_accept(struct thread *thread) zlog_err ("accept_sock is negative value %d", accept_sock); return -1; } - listener->thread = thread_add_read(master, pim_msdp_sock_accept, listener, - accept_sock, NULL); + listener->thread = NULL; + thread_add_read(master, pim_msdp_sock_accept, listener, accept_sock, + &listener->thread); /* accept client connection. */ msdp_sock = sockunion_accept(accept_sock, &su); @@ -173,8 +174,9 @@ pim_msdp_sock_listen(void) /* add accept thread */ listener->fd = sock; memcpy(&listener->su, &sin, socklen); - listener->thread = thread_add_read(msdp->master, pim_msdp_sock_accept, - listener, sock, NULL); + listener->thread = NULL; + thread_add_read(msdp->master, pim_msdp_sock_accept, listener, sock, + &listener->thread); msdp->flags |= PIM_MSDPF_LISTENER; return 0; |
