]> granicus.if.org Git - strace/commitdiff
tests: robustify umount and umount2 tests against future kernel changes
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 16 Apr 2019 00:27:42 +0000 (00:27 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 16 Apr 2019 00:27:42 +0000 (00:27 +0000)
Prepare for the rename of umount syscall to umount2 introduced by linux
kernel commits v5.1-rc1~160^2~3^2~12 and v5.1-rc1~160^2~3^2~16 on alpha
and ia64 architectures, respectively.

* tests/umount.c: Check for __NR_umount == __NR_umount2.
* tests/umount2.c: Likewise.

tests/umount.c
tests/umount2.c

index 9c709f228a040694728dca8e5520db834c4dcad3..0170ca8be35fd4f014256e8f6168cc63c41d0648 100644 (file)
@@ -15,7 +15,7 @@
 #ifdef __NR_oldumount
 # define TEST_SYSCALL_STR "oldumount"
 #else
-# if defined __NR_umount && defined __NR_umount2
+# if defined __NR_umount && defined __NR_umount2 && __NR_umount != __NR_umount2
 #  define __NR_oldumount __NR_umount
 #  define TEST_SYSCALL_STR "umount"
 # endif
index a64c18d6f03aecce83cf69d747103dcf5bae35dd..134eb349a02e5e294d7e3d30f70c10a3bbb0df0c 100644 (file)
@@ -12,7 +12,7 @@
 #include <sys/mount.h>
 #include <asm/unistd.h>
 
-#ifdef __NR_umount2
+#if defined __NR_umount2 && (!defined __NR_umount || __NR_umount2 != __NR_umount)
 # define TEST_SYSCALL_STR "umount2"
 #else
 # define __NR_umount2 __NR_umount