From 472ce305351fd99c3bcb9759b6adb60f3a21e4c8 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 15 Aug 2016 15:20:38 +0000 Subject: [PATCH] tests: fix pause.test when pause syscall is not available * tests/pause.c (main): Fix expected output when pause syscall is not available. --- tests/pause.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/pause.c b/tests/pause.c index 7f6d566c..86873620 100644 --- a/tests/pause.c +++ b/tests/pause.c @@ -33,6 +33,7 @@ #ifdef __NR_pause +# include # include # include # include @@ -60,8 +61,12 @@ main(void) if (setitimer(ITIMER_REAL, &itv, NULL)) perror_msg_and_fail("setitimer"); - pause(); - printf("pause() = ? ERESTARTNOHAND (To be restarted if no handler)\n"); + syscall(__NR_pause); + if (errno == ENOSYS) + printf("pause() = -1 ENOSYS (%m)\n"); + else + printf("pause() = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n"); puts("+++ exited with 0 +++"); return 0; -- 2.40.0