diff options
Diffstat (limited to 'tools/lib/bpf/str_error.c')
-rw-r--r-- | tools/lib/bpf/str_error.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/str_error.c b/tools/lib/bpf/str_error.c index 00e48ac5b806..b8064eedc177 100644 --- a/tools/lib/bpf/str_error.c +++ b/tools/lib/bpf/str_error.c | |||
@@ -11,7 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | char *libbpf_strerror_r(int err, char *dst, int len) | 12 | char *libbpf_strerror_r(int err, char *dst, int len) |
13 | { | 13 | { |
14 | int ret = strerror_r(err, dst, len); | 14 | int ret = strerror_r(err < 0 ? -err : err, dst, len); |
15 | if (ret) | 15 | if (ret) |
16 | snprintf(dst, len, "ERROR: strerror_r(%d)=%d", err, ret); | 16 | snprintf(dst, len, "ERROR: strerror_r(%d)=%d", err, ret); |
17 | return dst; | 17 | return dst; |