From: Dmitry V. Levin Date: Fri, 16 Sep 2016 23:14:40 +0000 (+0000) Subject: tests/xstatfsx.c: fix potential errno clobbering X-Git-Tag: v4.14~71 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8870b9e83142f6b68d6fba953cc41dff34e8f319;p=strace tests/xstatfsx.c: fix potential errno clobbering * tests/xstatfsx.c (main): Use sprintrc. --- diff --git a/tests/xstatfsx.c b/tests/xstatfsx.c index 35618663..c5c04be2 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 +++");