diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-05-05 23:22:25 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-05-09 22:44:22 +0200 |
commit | 66e78ae64bc4659848517953b365606e3e70e878 (patch) | |
tree | ef1339e397feed2b56b8d653d41c03aa5b2bd94f /ldpd/lde.c | |
parent | lib: safely check & set thread pointers (diff) | |
download | frr-66e78ae64bc4659848517953b365606e3e70e878.tar.xz frr-66e78ae64bc4659848517953b365606e3e70e878.zip |
*: 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 'ldpd/lde.c')
-rw-r--r-- | ldpd/lde.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ldpd/lde.c b/ldpd/lde.c index 2d87161ec..bef35f319 100644 --- a/ldpd/lde.c +++ b/ldpd/lde.c @@ -140,8 +140,9 @@ lde(void) fatal(NULL); imsg_init(&iev_main->ibuf, LDPD_FD_ASYNC); iev_main->handler_read = lde_dispatch_parent; - iev_main->ev_read = thread_add_read(master, iev_main->handler_read, - iev_main, iev_main->ibuf.fd, NULL); + iev_main->ev_read = NULL; + thread_add_read(master, iev_main->handler_read, iev_main, iev_main->ibuf.fd, + &iev_main->ev_read); iev_main->handler_write = ldp_write_handler; if ((iev_main_sync = calloc(1, sizeof(struct imsgev))) == NULL) @@ -526,11 +527,9 @@ lde_dispatch_parent(struct thread *thread) fatal(NULL); imsg_init(&iev_ldpe->ibuf, fd); iev_ldpe->handler_read = lde_dispatch_imsg; - iev_ldpe->ev_read = thread_add_read(master, - iev_ldpe->handler_read, - iev_ldpe, - iev_ldpe->ibuf.fd, - NULL); + iev_ldpe->ev_read = NULL; + thread_add_read(master, iev_ldpe->handler_read, iev_ldpe, iev_ldpe->ibuf.fd, + &iev_ldpe->ev_read); iev_ldpe->handler_write = ldp_write_handler; iev_ldpe->ev_write = NULL; break; |