From: Dmitry V. Levin Date: Mon, 15 Aug 2016 15:20:38 +0000 (+0000) Subject: tests: fix pause.test when pause syscall is not available X-Git-Tag: v4.14~196 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=472ce305351fd99c3bcb9759b6adb60f3a21e4c8;p=strace tests: fix pause.test when pause syscall is not available * tests/pause.c (main): Fix expected output when pause syscall is not available. --- 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;