diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2016-09-16 23:14:40 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2016-09-19 19:51:37 +0000 |
commit | 8870b9e83142f6b68d6fba953cc41dff34e8f319 (patch) | |
tree | cd9f1761dfe016255779f2b433a21063cb5fae39 /tests/xstatfsx.c | |
parent | 38ce2658cdc08d68412f55aeb5a736b303cd7dbd (diff) | |
download | strace-8870b9e83142f6b68d6fba953cc41dff34e8f319.tar.gz |
tests/xstatfsx.c: fix potential errno clobbering
* tests/xstatfsx.c (main): Use sprintrc.
Diffstat (limited to 'tests/xstatfsx.c')
-rw-r--r-- | tests/xstatfsx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/xstatfsx.c b/tests/xstatfsx.c index 35618663b..c5c04be2f 100644 --- a/tests/xstatfsx.c +++ b/tests/xstatfsx.c @@ -105,14 +105,16 @@ main(void) print_statfs(".", NULL); long rc = SYSCALL_INVOKE("", -1, 0, sizeof(STRUCT_STATFS)); + const char *errstr = sprintrc(rc); PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS)); - printf("NULL) = %ld %s (%m)\n", rc, errno2name()); + printf("NULL) = %s\n", errstr); #ifdef CHECK_ODD_SIZE const unsigned long addr = (unsigned long) 0xfacefeeddeadbeef; rc = SYSCALL_INVOKE("", -1, addr, sizeof(STRUCT_STATFS) + 1); + errstr = sprintrc(rc); PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS) + 1); - printf("%#lx) = %ld %s (%m)\n", addr, rc, errno2name()); + printf("%#lx) = %s\n", addr, errstr); #endif puts("+++ exited with 0 +++"); |