mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-29 08:07:24 +00:00
update(userspace/falco): add convenience method for merging app run results
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
parent
3f7d61f150
commit
7bb319b21e
@ -147,6 +147,21 @@ private:
|
||||
return r;
|
||||
}
|
||||
|
||||
// Merges two run results into one
|
||||
inline static run_result merge(const run_result& a, const run_result& b)
|
||||
{
|
||||
auto res = ok();
|
||||
res.proceed = a.proceed && b.proceed;
|
||||
res.success = a.success && b.success;
|
||||
res.errstr = a.errstr;
|
||||
if (!b.errstr.empty())
|
||||
{
|
||||
res.errstr += res.errstr.empty() ? "" : "\n";
|
||||
res.errstr += b.errstr;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
run_result();
|
||||
virtual ~run_result();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user