Skip to content

Commit

Permalink
fix(libsinsp/parsers): call immediately call on_erase_fd callback
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Jan 23, 2025
1 parent 6c46ed3 commit 8d9b144
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions userspace/libsinsp/parsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3222,21 +3222,8 @@ void sinsp_parser::erase_fd(erase_fd_params *params) {
m_inspector->get_fds_to_remove().push_back(params->m_fd);
}

//
// If there's a listener, add a callback to later invoke it.
//
if(m_inspector->get_observer()) {
auto ts = params->m_ts;
auto remove_from_table = params->m_remove_from_table;
auto fd = params->m_fd;
auto tinfo = params->m_tinfo;
auto fdinfo = params->m_fdinfo;
m_inspector->m_post_process_cbs.emplace(
[ts, remove_from_table, fd, tinfo, fdinfo](sinsp_observer *observer,
sinsp_evt *evt) {
erase_fd_params p = {remove_from_table, fd, tinfo, fdinfo, ts};
observer->on_erase_fd(&p);
});
m_inspector->get_observer()->on_erase_fd(params);
}
}

Expand Down

0 comments on commit 8d9b144

Please sign in to comment.