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>
This commit is contained in:

committed by
Arnaldo Carvalho de Melo

parent
35550da389
commit
ba3dfff8ad
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user