Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/timers: Add missing error code assignment before test

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>

authored by

Christophe JAILLET and committed by
Shuah Khan
c3cb8356 0ad46bec

+2 -2
+2 -2
tools/testing/selftests/timers/posix_timers.c
··· 122 122 else if (which == ITIMER_REAL) 123 123 idle_loop(); 124 124 125 - gettimeofday(&end, NULL); 125 + err = gettimeofday(&end, NULL); 126 126 if (err < 0) { 127 127 perror("Can't call gettimeofday()\n"); 128 128 return -1; ··· 175 175 176 176 user_loop(); 177 177 178 - gettimeofday(&end, NULL); 178 + err = gettimeofday(&end, NULL); 179 179 if (err < 0) { 180 180 perror("Can't call gettimeofday()\n"); 181 181 return -1;