]> granicus.if.org Git - strace/commitdiff
tests: fix pause.test when pause syscall is not available
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 15 Aug 2016 15:20:38 +0000 (15:20 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 15 Aug 2016 19:06:06 +0000 (22:06 +0300)
* tests/pause.c (main): Fix expected output when pause syscall
is not available.

tests/pause.c

index 7f6d566c27b688aeeea41ae7eff4017ebc190ca8..868736207f86f2174f10400a32c8b8a862cda4ea 100644 (file)
@@ -33,6 +33,7 @@
 
 #ifdef __NR_pause
 
+# include <errno.h>
 # include <signal.h>
 # include <stdio.h>
 # include <sys/time.h>
@@ -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;