aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/builtin-test.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>2014-08-14 02:22:45 +0000
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-08-15 13:07:28 -0300
commitba3dfff8ad2d98df0c8116faaeb281c93e161636 (patch)
tree2fa417b3aebbe73297242806eedb7a28633cb87b /tools/perf/tests/builtin-test.c
parentperf record: Use strerror_r instead of strerror (diff)
downloadlinux-dev-ba3dfff8ad2d98df0c8116faaeb281c93e161636.tar.xz
linux-dev-ba3dfff8ad2d98df0c8116faaeb281c93e161636.zip
perf test: Use strerror_r instead of strerror
Use strerror_r instead of strerror in error messages for thread-safety. Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Naohiro Aota <naota@elisp.net> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/20140814022245.3545.91394.stgit@kbuild-fedora.novalocal Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/builtin-test.c')
-rw-r--r--tools/perf/tests/builtin-test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index c6796d22423a..99481361b19f 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -185,9 +185,11 @@ static bool perf_test__matches(int curr, int argc, const char *argv[])
static int run_test(struct test *test)
{
int status, err = -1, child = fork();
+ char sbuf[STRERR_BUFSIZE];
if (child < 0) {
- pr_err("failed to fork test: %s\n", strerror(errno));
+ pr_err("failed to fork test: %s\n",
+ strerror_r(errno, sbuf, sizeof(sbuf)));
return -1;
}