public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] bpf_common.h: Use errno instead of TST_ERR
@ 2020-03-04  9:54 Yang Xu
  2020-03-04 10:31 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Xu @ 2020-03-04  9:54 UTC (permalink / raw)
  To: ltp

Since it doesn't call TEST, TST_ERR is always equal to 0.
Use errno instead of it.

Fixes: 5d3a2ec8cf0d ("Fix BPF test program loading issue")
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 testcases/kernel/syscalls/bpf/bpf_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/bpf/bpf_common.c b/testcases/kernel/syscalls/bpf/bpf_common.c
index 1db91e29a..fd299b73d 100644
--- a/testcases/kernel/syscalls/bpf/bpf_common.c
+++ b/testcases/kernel/syscalls/bpf/bpf_common.c
@@ -36,7 +36,7 @@ int bpf_map_create(union bpf_attr *attr)
 		TST_RETVAL_GE0);
 
 	if (ret == -1) {
-		if (TST_ERR == EPERM) {
+		if (errno == EPERM) {
 			tst_res(TCONF, "Hint: check also /proc/sys/kernel/unprivileged_bpf_disabled");
 			tst_brk(TCONF | TERRNO,
 				"bpf() requires CAP_SYS_ADMIN on this system");
-- 
2.18.0




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [LTP] [PATCH] bpf_common.h: Use errno instead of TST_ERR
  2020-03-04  9:54 [LTP] [PATCH] bpf_common.h: Use errno instead of TST_ERR Yang Xu
@ 2020-03-04 10:31 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2020-03-04 10:31 UTC (permalink / raw)
  To: ltp

Hi!
Good catch, applied, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-04 10:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-04  9:54 [LTP] [PATCH] bpf_common.h: Use errno instead of TST_ERR Yang Xu
2020-03-04 10:31 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox