Skip to content

Commit 10d5968

Browse files
Andreagit97poiana
authored andcommitted
cleanup: rename a method
Signed-off-by: Andrea Terzolo <[email protected]>
1 parent eb77f2a commit 10d5968

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

userspace/libsinsp/sinsp_filtercheck_fd.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,9 @@ int32_t sinsp_filter_check_fd::parse_field_name(std::string_view val,
374374
return sinsp_filter_check::parse_field_name(val, alloc_state, needed_for_filtering);
375375
}
376376

377-
bool sinsp_filter_check_fd::extract_fdname_from_creator(sinsp_evt *evt,
378-
bool sanitize_strings,
379-
bool fd_nameraw) {
377+
bool sinsp_filter_check_fd::extract_fdname_from_event(sinsp_evt *evt,
378+
bool sanitize_strings,
379+
bool fd_nameraw) {
380380
const char *resolved_argstr;
381381
uint16_t etype = evt->get_type();
382382

@@ -537,7 +537,7 @@ uint8_t *sinsp_filter_check_fd::extract_single(sinsp_evt *evt,
537537
int64_t retval = evt->get_param(0)->as<int64_t>();
538538
// this is a weird behavior, see the `net_connect_exit_event_fails` test for more info
539539
if(retval < 0) {
540-
if(!extract_fdname_from_creator(evt, sanitize_strings)) {
540+
if(!extract_fdname_from_event(evt, sanitize_strings)) {
541541
return NULL;
542542
}
543543
if(m_field_id == TYPE_CONTAINERNAME) {
@@ -549,7 +549,7 @@ uint8_t *sinsp_filter_check_fd::extract_single(sinsp_evt *evt,
549549
}
550550

551551
if(m_fdinfo == NULL) {
552-
if(!extract_fdname_from_creator(evt, sanitize_strings)) {
552+
if(!extract_fdname_from_event(evt, sanitize_strings)) {
553553
return NULL;
554554
}
555555
} else {
@@ -578,7 +578,7 @@ uint8_t *sinsp_filter_check_fd::extract_single(sinsp_evt *evt,
578578
case TYPE_DIRECTORY:
579579
case TYPE_CONTAINERDIRECTORY: {
580580
if(m_fdinfo == NULL) {
581-
if(!extract_fdname_from_creator(evt, sanitize_strings)) {
581+
if(!extract_fdname_from_event(evt, sanitize_strings)) {
582582
return NULL;
583583
}
584584
} else if(!(m_fdinfo->is_file() || m_fdinfo->is_directory())) {
@@ -1226,7 +1226,7 @@ uint8_t *sinsp_filter_check_fd::extract_single(sinsp_evt *evt,
12261226
} break;
12271227
case TYPE_FDNAMERAW: {
12281228
if(m_fdinfo == NULL) {
1229-
if(!extract_fdname_from_creator(evt, sanitize_strings, true)) {
1229+
if(!extract_fdname_from_event(evt, sanitize_strings, true)) {
12301230
return NULL;
12311231
}
12321232
} else {

userspace/libsinsp/sinsp_filtercheck_fd.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,7 @@ class sinsp_filter_check_fd : public sinsp_filter_check {
8888

8989
private:
9090
int32_t extract_arg(std::string_view fldname, std::string_view val);
91-
bool extract_fdname_from_creator(sinsp_evt* evt,
92-
bool sanitize_strings,
93-
bool fd_nameraw = false);
91+
bool extract_fdname_from_event(sinsp_evt* evt, bool sanitize_strings, bool fd_nameraw = false);
9492
bool extract_fd(sinsp_evt* evt);
9593

9694
bool compare_ip(sinsp_evt* evt);

userspace/libsinsp/sinsp_filtercheck_fspath.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ uint8_t* sinsp_filter_check_fspath::extract_single(sinsp_evt* evt,
401401

402402
if(!std::filesystem::path(m_tstr).is_absolute()) {
403403
std::string sdir; // init
404-
// Compare to `sinsp_filter_check_fd::extract_fdname_from_creator` logic
404+
// Compare to `sinsp_filter_check_fd::extract_fdname_from_event` logic
405405
// note: no implementation for old / legacy event definitions
406406
switch(evt->get_type()) {
407407
// For openat, event fdinfo is already correctly expanded by parsers;

0 commit comments

Comments
 (0)