alarm02: fix for 32-bit kernels
PATCH 1/1 alarm02: fix for 32-bit kernels
Test fails on 32-bit kernels with:
alarm02.c:55: FAIL: alarm(4294967295) returned 2147483647 as unexpected
because kernel alarm_setitimer() limits seconds to INT_MAX to avoid negative timeval settings which would cause immediate expiry:
static unsigned int alarm_setitimer(unsigned int seconds)
{
struct itimerval it_new, it_old; #if BITS_PER_LONG < 64
if (seconds > INT_MAX)
seconds = INT_MAX;
#endifDon't test UINT_MAX.
Signed-off-by Jan Stancek <[email protected]>
--- testcases/kernel/syscalls/alarm/alarm02.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/syscalls/alarm/alarm02.c +1 -1
@@ -21,7 +21,7 @@ static struct tcase {char *str;unsigned int sec; } tcases[] = { - {"UINT_MAX", UINT_MAX}, + {"INT_MAX", INT_MAX}, {"UINT_MAX/2", UINT_MAX/2}, {"UINT_MAX/4", UINT_MAX/4}, };
Signature · 1 line
1.8.3.1
PATCH 1/1 alarm02: fix for 32-bit kernels
Hi!
Looks good, acked.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 alarm02: fix for 32-bit kernels
----- Original Message -----
Quoted 2 lines
Hi!
Looks good, acked.
Pushed.
Regards,
Jan