Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Fix bpf_prog_detach2 usage in test_lirc_mode2

Commit e9fc3ce99b34 ("libbpf: Streamline error reporting for high-level
APIs") redefined the way that bpf_prog_detach2() returns. Therefore, adapt
the usage in test_lirc_mode2_user.c.

Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20250828-selftests-bpf-v1-1-c7811cd8b98c@suse.com

authored by

Ricardo B. Marlière and committed by
Andrii Nakryiko
98857d11 737433c6

+1 -1
+1 -1
tools/testing/selftests/bpf/test_lirc_mode2_user.c
··· 74 74 75 75 /* Let's try detach it before it was ever attached */ 76 76 ret = bpf_prog_detach2(progfd, lircfd, BPF_LIRC_MODE2); 77 - if (ret != -1 || errno != ENOENT) { 77 + if (ret != -ENOENT) { 78 78 printf("bpf_prog_detach2 not attached should fail: %m\n"); 79 79 return 1; 80 80 }