public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib/tst_af_alg.c: Fix wrong errno for unsupported AF_ALG
@ 2019-03-19  3:25 Xiao Yang
  2019-03-19 16:40 ` Eric Biggers
  0 siblings, 1 reply; 3+ messages in thread
From: Xiao Yang @ 2019-03-19  3:25 UTC (permalink / raw)
  To: ltp

According to socket(2) manpage and source code, socket(2) actually
returns EAFNOSUPPORT instead of EPROTONOSUPPORT when AF_ALG is not
supported by kernel.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 lib/tst_af_alg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tst_af_alg.c b/lib/tst_af_alg.c
index 9ce1ca4..97be548 100644
--- a/lib/tst_af_alg.c
+++ b/lib/tst_af_alg.c
@@ -16,7 +16,7 @@ int tst_alg_create(void)
 	TEST(socket(AF_ALG, SOCK_SEQPACKET, 0));
 	if (TST_RET >= 0)
 		return TST_RET;
-	if (TST_ERR == EPROTONOSUPPORT)
+	if (TST_ERR == EAFNOSUPPORT)
 		tst_brk(TCONF, "kernel doesn't support AF_ALG");
 	tst_brk(TBROK | TTERRNO, "unexpected error creating AF_ALG socket");
 	return -1;
-- 
1.8.3.1




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

end of thread, other threads:[~2019-03-20  1:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19  3:25 [LTP] [PATCH] lib/tst_af_alg.c: Fix wrong errno for unsupported AF_ALG Xiao Yang
2019-03-19 16:40 ` Eric Biggers
2019-03-20  1:49   ` Xiao Yang

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