summaryrefslogtreecommitdiff
path: root/tools/perf/util/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/target.c')
-rw-r--r--tools/perf/util/target.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/tools/perf/util/target.c b/tools/perf/util/target.c
index a53603b27..21c4d9b23 100644
--- a/tools/perf/util/target.c
+++ b/tools/perf/util/target.c
@@ -7,6 +7,7 @@
*/
#include "target.h"
+#include "util.h"
#include "debug.h"
#include <pwd.h>
@@ -121,11 +122,7 @@ int target__strerror(struct target *target, int errnum,
BUG_ON(buflen == 0);
if (errnum >= 0) {
- const char *err = strerror_r(errnum, buf, buflen);
-
- if (err != buf)
- scnprintf(buf, buflen, "%s", err);
-
+ str_error_r(errnum, buf, buflen);
return 0;
}