]> granicus.if.org Git - strace/commitdiff
tests: fix xgetrlimit output when syscall returns an error
authorEugene Syromyatnikov <evgsyr@gmail.com>
Thu, 21 Feb 2019 15:52:46 +0000 (16:52 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 25 Feb 2019 19:08:05 +0000 (19:08 +0000)
* tests/xgetrlimit.c (main): Expect pointer to rlimit as the second
argument when syscall returns an error.  Use sprintrc().

tests/xgetrlimit.c

index deaad254368aab66c55452faea914441ed8262e2..9dad120f7762463f266c05e252ffaac39444495d 100644 (file)
@@ -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,