diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2016-05-16 21:01:43 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2016-05-16 21:46:48 +0000 |
commit | 77086594ce4ff74a6afa5d4570d2a1dfbc5ae3c5 (patch) | |
tree | e77a17226f7c029b71ec67a4f63f1a65903e2ad3 /tests/fcntl64.c | |
parent | 4811023e74adb61ca800b502f0a956992db2cde6 (diff) | |
download | strace-77086594ce4ff74a6afa5d4570d2a1dfbc5ae3c5.tar.gz |
Fix decoding of fcntl/fcntl64 operation argument
Consistently treat operation argument of fcntl/fcntl64 syscalls as int
to match the kernel behaviour.
* fcntl.c (print_fcntl, SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Assign
2nd argument of syscall to a variable of type unsigned int
and use it in all subsequent checks and lookups.
* tests/struct_flock.c (invoke_test_syscall): New function.
(test_flock_einval, test_flock): Use it.
* tests/fcntl.c (test_flock64_einval): Use it.
* tests/fcntl64.c (test_flock64_einval, test_flock64): Use it.
Diffstat (limited to 'tests/fcntl64.c')
-rw-r--r-- | tests/fcntl64.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/fcntl64.c b/tests/fcntl64.c index 726576e62..b83a098d4 100644 --- a/tests/fcntl64.c +++ b/tests/fcntl64.c @@ -44,7 +44,7 @@ test_flock64_einval(const int cmd, const char *name) .l_start = 0xdefaced1facefeed, .l_len = 0xdefaced2cafef00d }; - syscall(TEST_SYSCALL_NR, 0, cmd, &fl); + invoke_test_syscall(cmd, &fl); printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); @@ -64,7 +64,7 @@ test_flock64(void) .l_type = F_RDLCK, .l_len = FILE_LEN }; - int rc = syscall(TEST_SYSCALL_NR, 0, F_SETLK64, &fl); + long rc = invoke_test_syscall(F_SETLK64, &fl); printf("%s(0, F_SETLK64, {l_type=F_RDLCK, l_whence=SEEK_SET" ", l_start=0, l_len=%d}) = %s\n", TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); @@ -72,12 +72,12 @@ test_flock64(void) if (rc) return; - syscall(TEST_SYSCALL_NR, 0, F_GETLK64, &fl); + invoke_test_syscall(F_GETLK64, &fl); printf("%s(0, F_GETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" ", l_start=0, l_len=%d, l_pid=0}) = 0\n", TEST_SYSCALL_STR, FILE_LEN); - syscall(TEST_SYSCALL_NR, 0, F_SETLK64, &fl); + invoke_test_syscall(F_SETLK64, &fl); printf("%s(0, F_SETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" ", l_start=0, l_len=%d}) = 0\n", TEST_SYSCALL_STR, FILE_LEN); |