Skip to content

Commit

Permalink
chore(libsinsp): style, lint
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Guerra <[email protected]>
Co-authored-by: Mauro Ezequiel Moltrasio <[email protected]>
Co-authored-by: Federico Di Pierro <[email protected]>
  • Loading branch information
3 people authored and poiana committed Sep 25, 2024
1 parent 227233b commit e1999d0
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions userspace/libsinsp/parsers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,24 +422,28 @@ void sinsp_parser::process_event(sinsp_evt *evt) {
case PPME_SYSCALL_MKDIRAT_X:
case PPME_SYSCALL_UNLINKAT_2_X:
case PPME_SYSCALL_MKNODAT_X: {
if (evt->get_tinfo() != nullptr) {
auto res = evt->get_param(0)->as<int64_t>();
if(res >= 0) {
// Only if successful
auto dirfd = evt->get_param(1)->as<int64_t>();
evt->set_fd_info(evt->get_tinfo()->get_fd(dirfd));
}
if(evt->get_tinfo() == nullptr) {
break;
}

auto res = evt->get_param(0)->as<int64_t>();
if(res >= 0) {
// Only if successful
auto dirfd = evt->get_param(1)->as<int64_t>();
evt->set_fd_info(evt->get_tinfo()->get_fd(dirfd));
}
break;
}
case PPME_SYSCALL_SYMLINKAT_X: {
if (evt->get_tinfo() != nullptr) {
auto res = evt->get_param(0)->as<int64_t>();
if(res >= 0) {
// Only if successful
auto dirfd = evt->get_param(2)->as<int64_t>();
evt->set_fd_info(evt->get_tinfo()->get_fd(dirfd));
}
if(evt->get_tinfo() == nullptr) {
break;
}

auto res = evt->get_param(0)->as<int64_t>();
if(res >= 0) {
// Only if successful
auto dirfd = evt->get_param(2)->as<int64_t>();
evt->set_fd_info(evt->get_tinfo()->get_fd(dirfd));
}
break;
}
Expand Down

0 comments on commit e1999d0

Please sign in to comment.