From cfed768b5802d16c6d462f65a0d709c70b2cda44 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 16 Jul 2019 17:46:47 +0000 Subject: [PATCH] tests: robustify alarm test Do not assume that alarm syscall always succeeds. * tests/alarm.c (main): Use sprintrc. --- tests/alarm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/alarm.c b/tests/alarm.c index 35404535..f9fe29a5 100644 --- a/tests/alarm.c +++ b/tests/alarm.c @@ -18,8 +18,8 @@ int main(void) { - int rc = syscall(__NR_alarm, (unsigned long) 0xffffffff0000002aULL); - printf("alarm(%u) = %d\n", 42, rc); + const unsigned long arg = (unsigned long) 0xffffffff0000002aULL; + printf("alarm(%u) = %s\n", 42, sprintrc(syscall(__NR_alarm, arg))); puts("+++ exited with 0 +++"); return 0; -- 2.40.0