]> granicus.if.org Git - strace/commitdiff
tests: fix strace-k.test on alpha
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 1 Jan 2019 21:36:08 +0000 (21:36 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 1 Jan 2019 21:36:08 +0000 (21:36 +0000)
Change strace-k.test to use chdir syscall instead of getpid syscall
because the latter is not universally available, e.g. there is no getpid
syscall on alpha.

* tests/stack-fcall-3.c (f3) <default>: Replace getpid with chdir.
* tests/strace-k.test: Likewise.
* tests/strace-k.expected: Likewise.
* tests/strace-k-demangle.expected: Likewise.
* NEWS: Mention this.

NEWS
tests/stack-fcall-3.c
tests/strace-k-demangle.expected
tests/strace-k.expected
tests/strace-k.test

diff --git a/NEWS b/NEWS
index db190a2d175373fcd63b5b13d02f26c774326ee3..616d594e3268e074400b58dba7bd5f4d888e8b01 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
 Noteworthy changes in release ?.?? (????-??-??)
 ===============================================
 
+* Bug fixes
+  * Fixed strace-k test on alpha.
+
 Noteworthy changes in release 4.26 (2018-12-26)
 ===============================================
 
index 3e0a705d16189ad44d0e1635d48c4c858dd37cc7..312da553afb0e27b85d067adaa4639b965d99d4d 100644 (file)
 
 int f3(int i)
 {
-       static int pid;
-
        switch (i) {
        case 1:
-               return kill(pid, SIGURG);
+               return kill(getpid(), SIGURG);
 
        default:
-               return (pid = getpid()) + i;
+               return chdir("") + i;
        }
 
 }
index 54c6f50c4e242fd00c22da46ec4b35e4c0e7cfe9..c1b48037d1df59c9921837f855b7366d61df3c30 100644 (file)
@@ -1,2 +1,2 @@
-^getpid .*(__kernel_vsyscall )?(__)?getpid ns::f3\(int\) ns::f2\(int\) ns::f1\(int\) ns::f0\(int\) main
+^chdir .*(__kernel_vsyscall )?(__)?chdir ns::f3\(int\) ns::f2\(int\) ns::f1\(int\) ns::f0\(int\) main
 ^SIGURG .*(__kernel_vsyscall )?(__)?kill ns::f3\(int\) ns::f2\(int\) ns::f1\(int\) ns::f0\(int\) main
index e83ac955db34fa0077309e29fb387f228ebf15ac..e40c339e4094bccee84f082739fd567b1f10756c 100644 (file)
@@ -1,2 +1,2 @@
-^getpid .*(__kernel_vsyscaln )?(__)?getpid f3 f2 f1 f0 main
+^chdir .*(__kernel_vsyscaln )?(__)?chdir f3 f2 f1 f0 main
 ^SIGURG .*(__kernel_vsyscaln )?(__)?kill f3 f2 f1 f0 main
index 43fddb56f7eb330b1be3bb057c1ab77864ff16cd..4fc8c6dff5f336a55ebf633fa75d7a37670c7229 100755 (executable)
@@ -20,7 +20,7 @@ check_prog sed
 check_prog tr
 
 run_prog "${test_prog=../stack-fcall}"
-run_strace -e getpid -k $args
+run_strace -e chdir -k $args
 
 expected="$srcdir/$NAME.expected"
 awk '