public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lib/tst_af_alg.c: Fix wrong errno for unsupported AF_ALG
Date: Tue, 19 Mar 2019 09:40:19 -0700	[thread overview]
Message-ID: <20190319164017.GA202956@gmail.com> (raw)
In-Reply-To: <1552965902-22452-1-git-send-email-yangx.jy@cn.fujitsu.com>

On Tue, Mar 19, 2019 at 11:25:02AM +0800, Xiao Yang wrote:
> 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
> 
> 
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

Thanks, somehow I missed this.

Reviewed-by: Eric Biggers <ebiggers@google.com>

  reply	other threads:[~2019-03-19 16:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2019-03-20  1:49   ` Xiao Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190319164017.GA202956@gmail.com \
    --to=ebiggers@kernel.org \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox