Explorar o código

Restore previous check for bpf_get_stackid

tirex %!s(int64=2) %!d(string=hai) anos
pai
achega
741c35f555
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      bpf/aya-bpf/src/maps/stack_trace.rs

+ 3 - 3
bpf/aya-bpf/src/maps/stack_trace.rs

@@ -47,10 +47,10 @@ impl StackTrace {
 
     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);
-        if ret == 0 {
-            Ok(())
-        } else {
+        if ret < 0 {
             Err(ret)
+        } else {
+            Ok(ret)
         }
     }
 }