Restore previous check for bpf_get_stackid

pull/326/head
tirex 2 years ago
parent 42c4d5c3af
commit 741c35f555

@ -47,10 +47,10 @@ impl StackTrace {
pub unsafe fn get_stackid<C: BpfContext>(&self, ctx: &C, flags: u64) -> Result<i64, i64> { pub unsafe fn get_stackid<C: BpfContext>(&self, ctx: &C, flags: u64) -> Result<i64, i64> {
let ret = bpf_get_stackid(ctx.as_ptr(), self.def.get() as *mut _, flags); let ret = bpf_get_stackid(ctx.as_ptr(), self.def.get() as *mut _, flags);
if ret == 0 { if ret < 0 {
Ok(())
} else {
Err(ret) Err(ret)
} else {
Ok(ret)
} }
} }
} }

Loading…
Cancel
Save