Skip to content

Commit b84ce33

Browse files
committed
Check fr_network_listen_delete for errors
1 parent 001c5fa commit b84ce33

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/listen/detail/proto_detail_file.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,11 @@ static int mod_close(fr_listen_t *li)
745745
proto_detail_file_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_detail_file_t);
746746
proto_detail_file_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_detail_file_thread_t);
747747

748-
if (thread->nr) (void) fr_network_listen_delete(thread->nr, inst->parent->listen);
748+
if (thread->nr) {
749+
if (unlikely(fr_network_listen_delete(thread->nr, inst->parent->listen) < 0)) {
750+
PERROR("Failed removing listener from network on detach");
751+
}
752+
}
749753

750754
/*
751755
* @todo - have our OWN event loop for timers, and a
@@ -756,7 +760,9 @@ static int mod_close(fr_listen_t *li)
756760

757761
if (thread->vnode_fd >= 0) {
758762
if (thread->nr) {
759-
(void) fr_network_listen_delete(thread->nr, inst->parent->listen);
763+
if (unlikely(fr_network_listen_delete(thread->nr, inst->parent->listen) < 0)) {
764+
PERROR("Failed removing listener from network on detach");
765+
}
760766
} else {
761767
if (fr_event_fd_delete(thread->el, thread->vnode_fd, FR_EVENT_FILTER_VNODE) < 0) {
762768
PERROR("Failed removing DELETE callback on detach");

0 commit comments

Comments
 (0)