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:	Tue, 09 Aug 2016 12:20:06 +0200
From:	walter harms <wharms@....de>
To:	Christophe JAILLET <christophe.jaillet@...adoo.fr>
CC:	john.stultz@...aro.org, tglx@...utronix.de,
	shuahkh@....samsung.com, linux-kselftest@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] selftests/timers: Add missing error code assignment before
 test


The patch looks ok.
but perhaps it is better to replace this with clock_gettime() ?

from the manpage:
"POSIX.1-2008 marks gettimeofday() as obsolete, recommending the
 use of clock_gettime(2) instead."

just my 2 cents.

re,
 wh


Am 09.08.2016 12:11, schrieb Christophe JAILLET:
> In order to work, the 'err' return value has to be updated otherwise the
> test can never be true.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
>  tools/testing/selftests/timers/posix_timers.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/timers/posix_timers.c b/tools/testing/selftests/timers/posix_timers.c
> index 5a246a0..15cf56d 100644
> --- a/tools/testing/selftests/timers/posix_timers.c
> +++ b/tools/testing/selftests/timers/posix_timers.c
> @@ -122,7 +122,7 @@ static int check_itimer(int which)
>  	else if (which == ITIMER_REAL)
>  		idle_loop();
>  
> -	gettimeofday(&end, NULL);
> +	err = gettimeofday(&end, NULL);
>  	if (err < 0) {
>  		perror("Can't call gettimeofday()\n");
>  		return -1;
> @@ -175,7 +175,7 @@ static int check_timer_create(int which)
>  
>  	user_loop();
>  
> -	gettimeofday(&end, NULL);
> +	err = gettimeofday(&end, NULL);
>  	if (err < 0) {
>  		perror("Can't call gettimeofday()\n");
>  		return -1;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ