Skip to content

Commit

Permalink
Return default of false for _bpf_enabled() (#1355)
Browse files Browse the repository at this point in the history
If the scap handle doesn't exist, return false from _bpf_enabled()
methods.
  • Loading branch information
mstemm authored Apr 2, 2019
1 parent c9293a9 commit c6bd3b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions userspace/libscap/scap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1973,6 +1973,8 @@ bool scap_get_bpf_enabled(scap_t *handle)
{
return handle->m_bpf;
}

return false;
}

int32_t scap_suppress_events_comm(scap_t *handle, const char *comm)
Expand Down
2 changes: 2 additions & 0 deletions userspace/libsinsp/sinsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,8 @@ bool sinsp::is_bpf_enabled()
{
return scap_get_bpf_enabled(m_h);
}

return false;
}

///////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit c6bd3b1

Please sign in to comment.