From: Eugene Syromyatnikov Date: Thu, 21 Feb 2019 15:52:46 +0000 (+0100) Subject: tests: fix xgetrlimit output when syscall returns an error X-Git-Tag: v5.0~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8fd4293668279f7b603937ea03942a17370cbfc;p=strace tests: fix xgetrlimit output when syscall returns an error * tests/xgetrlimit.c (main): Expect pointer to rlimit as the second argument when syscall returns an error. Use sprintrc(). --- diff --git a/tests/xgetrlimit.c b/tests/xgetrlimit.c index deaad254..9dad120f 100644 --- a/tests/xgetrlimit.c +++ b/tests/xgetrlimit.c @@ -83,13 +83,13 @@ main(void) long rc = syscall(NR_GETRLIMIT, res, 0); if (rc && ENOSYS == errno) perror_msg_and_skip(STR_GETRLIMIT); - printf("%s(%s, NULL) = %ld %s (%m)\n", - STR_GETRLIMIT, xlat->str, rc, errno2name()); + printf("%s(%s, NULL) = %s\n", + STR_GETRLIMIT, xlat->str, sprintrc(rc)); rc = syscall(NR_GETRLIMIT, res, rlimit); if (rc) - printf("%s(%s, NULL) = %ld %s (%m)\n", - STR_GETRLIMIT, xlat->str, rc, errno2name()); + printf("%s(%s, %p) = %s\n", + STR_GETRLIMIT, xlat->str, rlimit, sprintrc(rc)); else printf("%s(%s, {rlim_cur=%s, rlim_max=%s})" " = 0\n", STR_GETRLIMIT, xlat->str,