From 15d574a899325f6de3822ddac653b7d0e13bc9c0 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 17 Apr 2017 04:36:54 +0000 Subject: [PATCH] numa: fix printing of error values in move_pages status array * numa.c (print_status): Do not lose a minus sign when printing a symbolic error code. * tests/move_pages.c (print_status_array): Update expected output. --- numa.c | 2 +- tests/move_pages.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/numa.c b/numa.c index c2cd143a..eccd4ee7 100644 --- a/numa.c +++ b/numa.c @@ -142,7 +142,7 @@ print_status(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) const int status = * (int *) elem_buf; if (status < 0 && (unsigned) -status < nerrnos) - tprintf("%s", errnoent[-status]); + tprintf("-%s", errnoent[-status]); else tprintf("%d", status); diff --git a/tests/move_pages.c b/tests/move_pages.c index d9715001..5868b03f 100644 --- a/tests/move_pages.c +++ b/tests/move_pages.c @@ -126,7 +126,7 @@ print_status_array(const int *const status, const unsigned long count) printf("%d", status[i]); } else { errno = -status[i]; - printf("%s", errno2name()); + printf("-%s", errno2name()); } } printf("]"); -- 2.40.0