Skip to content

Commit

Permalink
selftests/timers: Add missing error code assignment before test
Browse files Browse the repository at this point in the history
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@wanadoo.fr>
Acked-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
  • Loading branch information
tititiou36 authored and Shuah Khan committed Sep 20, 2016
1 parent 0ad46be commit c3cb835
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/timers/posix_timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c3cb835

Please sign in to comment.