From e1999d079880d10800c57e004fca794a03cd060a Mon Sep 17 00:00:00 2001 From: Luca Guerra Date: Wed, 25 Sep 2024 09:14:10 +0000 Subject: [PATCH] chore(libsinsp): style, lint Signed-off-by: Luca Guerra Co-authored-by: Mauro Ezequiel Moltrasio Co-authored-by: Federico Di Pierro --- userspace/libsinsp/parsers.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/userspace/libsinsp/parsers.cpp b/userspace/libsinsp/parsers.cpp index 7f357a6503..37b7afcb51 100644 --- a/userspace/libsinsp/parsers.cpp +++ b/userspace/libsinsp/parsers.cpp @@ -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(); - if(res >= 0) { - // Only if successful - auto dirfd = evt->get_param(1)->as(); - evt->set_fd_info(evt->get_tinfo()->get_fd(dirfd)); - } + if(evt->get_tinfo() == nullptr) { + break; + } + + auto res = evt->get_param(0)->as(); + if(res >= 0) { + // Only if successful + auto dirfd = evt->get_param(1)->as(); + 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(); - if(res >= 0) { - // Only if successful - auto dirfd = evt->get_param(2)->as(); - evt->set_fd_info(evt->get_tinfo()->get_fd(dirfd)); - } + if(evt->get_tinfo() == nullptr) { + break; + } + + auto res = evt->get_param(0)->as(); + if(res >= 0) { + // Only if successful + auto dirfd = evt->get_param(2)->as(); + evt->set_fd_info(evt->get_tinfo()->get_fd(dirfd)); } break; }