File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -81,9 +81,10 @@ let with_bpf_object_open_load_link ~obj_path ~program_names
81
81
failwith_f " Failed to find %s programs" (String. concat " ," not_found));
82
82
83
83
(* Run before_link user initialization code *)
84
- Fun. protect
85
- ~finally: (fun () -> bpf_object_close obj)
86
- (fun () -> before_link obj);
84
+ (try before_link obj
85
+ with e ->
86
+ bpf_object_close obj;
87
+ raise e);
87
88
88
89
(* Get list of links *)
89
90
let links, not_attached =
@@ -98,9 +99,13 @@ let with_bpf_object_open_load_link ~obj_path ~program_names
98
99
(* Detached successfully attached before shutdown *)
99
100
cleanup ~links obj;
100
101
failwith_f " Failed to link %s programs" (String. concat " ," not_attached));
102
+ Printf. printf " IM HERE\n %!" ;
101
103
102
104
(* Run user program *)
103
- Fun. protect ~finally: (fun () -> cleanup ~links obj) (fun () -> fn obj links);
105
+ (try fn obj links
106
+ with e ->
107
+ cleanup ~links obj;
108
+ raise e);
104
109
105
110
(* Ensure proper shutdown *)
106
111
cleanup ~links obj
You can’t perform that action at this time.
0 commit comments