lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 13 Mar 2015 21:37:20 +1100
From:	Michael Ellerman <mpe@...erman.id.au>
To:	Andrey Vagin <avagin@...nvz.org>
Cc:	linux-kernel@...r.kernel.org, Shuah Khan <shuahkh@....samsung.com>,
	Cyrill Gorcunov <gorcunov@...nvz.org>
Subject: Re: [PATCH] selftests/kcmp: exit with non-zero code in a fail case

On Fri, 2015-03-13 at 12:27 +0300, Andrey Vagin wrote:
> diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
> index 572c888..a0ec8b8 100644
> --- a/tools/testing/selftests/kselftest.h
> +++ b/tools/testing/selftests/kselftest.h
> @@ -58,5 +58,17 @@ static inline int ksft_exit_skip(void)
>  {
>  	exit(4);
>  }
> +static inline int ksft_exit(void)
> +{
> +	if (ksft_cnt.ksft_fail)
> +		return ksft_exit_fail();
> +	if (ksft_cnt.ksft_xpass)
> +		return ksft_exit_xpass();
> +	if (ksft_cnt.ksft_xskip)
> +		return ksft_exit_skip();
> +	if (ksft_cnt.ksft_xfail)
> +		return ksft_exit_xfail();
> +	ksft_exit_pass();
> +}

This function claims to return 'int', but doesn't. So do all the others.

It could be as simple as:

static inline void ksft_exit(void)
{
	if (ksft_cnt.ksft_fail)
		exit(1);

	if (ksft_cnt.ksft_xpass)
		exit(3);

	if (ksft_cnt.ksft_xskip)
		exit(4);

	if (ksft_cnt.ksft_xfail)
		exit(2);

	exit(0);
}

cheers



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ