]> granicus.if.org Git - strace/commitdiff
tests/restart_syscall: skip if nanosleep looks uninterrupted
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 27 Jul 2015 12:34:58 +0000 (12:34 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 27 Jul 2015 15:27:43 +0000 (15:27 +0000)
* tests/restart_syscall.test: Skip if restart_syscall is not detected
and nanosleep syscall looks uninterrupted.

tests/restart_syscall.test

index 5ae3a1d587d11d80ed36a553cc13da3dce0ae5ac..1daa31651162be596492314554b3edd71d07daff 100755 (executable)
@@ -7,12 +7,17 @@
 check_prog sleep
 check_prog grep
 run_strace -enanosleep sleep 1
-grep nanosleep < "$LOG" > /dev/null ||
+LC_ALL=C grep ^nanosleep < "$LOG" > /dev/null ||
        framework_skip_ 'sleep does not use nanosleep'
 
 ./set_ptracer_any sleep 2 &
 sleep 1
-run_strace -q -erestart_syscall -p $!
+run_strace -q -erestart_syscall,nanosleep -p $!
+
+LC_ALL=C grep ^restart_syscall < "$LOG" > /dev/null ||
+if LC_ALL=C grep -x 'nanosleep({2, 0}, NULL) \+= 0' < "$LOG" > /dev/null; then
+       skip_ 'no restart_syscall, uninterrupted nanosleep'
+fi
 
 case "$STRACE_ARCH" in
        alpha|mips|or1k|s390|s390x)