diff options
| author | Dmitry Torokhov <[email protected]> | 2023-05-01 15:20:08 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2023-05-01 15:20:08 -0700 | 
| commit | 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e (patch) | |
| tree | d57f3a63479a07b4e0cece029886e76e04feb984 /samples/bpf/test_current_task_under_cgroup_user.c | |
| parent | 5dc63e56a9cf8df0b59c234a505a1653f1bdf885 (diff) | |
| parent | 53bea86b5712c7491bb3dae12e271666df0a308c (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 6.4 merge window.
Diffstat (limited to 'samples/bpf/test_current_task_under_cgroup_user.c')
| -rw-r--r-- | samples/bpf/test_current_task_under_cgroup_user.c | 8 | 
1 files changed, 5 insertions, 3 deletions
diff --git a/samples/bpf/test_current_task_under_cgroup_user.c b/samples/bpf/test_current_task_under_cgroup_user.c index ac251a417f45..9726ed2a8a8b 100644 --- a/samples/bpf/test_current_task_under_cgroup_user.c +++ b/samples/bpf/test_current_task_under_cgroup_user.c @@ -14,14 +14,14 @@  int main(int argc, char **argv)  {  	pid_t remote_pid, local_pid = getpid(); +	int cg2 = -1, idx = 0, rc = 1;  	struct bpf_link *link = NULL;  	struct bpf_program *prog; -	int cg2, idx = 0, rc = 1;  	struct bpf_object *obj;  	char filename[256];  	int map_fd[2]; -	snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]); +	snprintf(filename, sizeof(filename), "%s.bpf.o", argv[0]);  	obj = bpf_object__open_file(filename, NULL);  	if (libbpf_get_error(obj)) {  		fprintf(stderr, "ERROR: opening BPF object file failed\n"); @@ -103,7 +103,9 @@ int main(int argc, char **argv)  	rc = 0;  err: -	close(cg2); +	if (cg2 != -1) +		close(cg2); +  	cleanup_cgroup_environment();  cleanup:  |