diff options
author | Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> | 2014-08-13 22:22:49 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-08-15 12:07:59 -0400 |
commit | 340481ada1af9322d99e9c1ba874391f53ff4fce (patch) | |
tree | dc0046385840e7256504a231d3fe17b948766c3a | |
parent | fb74fbda42dc5bcbd9bae5d75bfb6755948db21d (diff) |
perf buildid-cache: 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/20140814022249.3545.53211.stgit@kbuild-fedora.novalocal
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-buildid-cache.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c index ac5838e0b1bd..70385756da63 100644 --- a/tools/perf/builtin-buildid-cache.c +++ b/tools/perf/builtin-buildid-cache.c | |||
@@ -291,6 +291,7 @@ int cmd_buildid_cache(int argc, const char **argv, | |||
291 | *missing_filename = NULL, | 291 | *missing_filename = NULL, |
292 | *update_name_list_str = NULL, | 292 | *update_name_list_str = NULL, |
293 | *kcore_filename; | 293 | *kcore_filename; |
294 | char sbuf[STRERR_BUFSIZE]; | ||
294 | 295 | ||
295 | struct perf_data_file file = { | 296 | struct perf_data_file file = { |
296 | .mode = PERF_DATA_MODE_READ, | 297 | .mode = PERF_DATA_MODE_READ, |
@@ -347,7 +348,7 @@ int cmd_buildid_cache(int argc, const char **argv, | |||
347 | continue; | 348 | continue; |
348 | } | 349 | } |
349 | pr_warning("Couldn't add %s: %s\n", | 350 | pr_warning("Couldn't add %s: %s\n", |
350 | pos->s, strerror(errno)); | 351 | pos->s, strerror_r(errno, sbuf, sizeof(sbuf))); |
351 | } | 352 | } |
352 | 353 | ||
353 | strlist__delete(list); | 354 | strlist__delete(list); |
@@ -365,7 +366,7 @@ int cmd_buildid_cache(int argc, const char **argv, | |||
365 | continue; | 366 | continue; |
366 | } | 367 | } |
367 | pr_warning("Couldn't remove %s: %s\n", | 368 | pr_warning("Couldn't remove %s: %s\n", |
368 | pos->s, strerror(errno)); | 369 | pos->s, strerror_r(errno, sbuf, sizeof(sbuf))); |
369 | } | 370 | } |
370 | 371 | ||
371 | strlist__delete(list); | 372 | strlist__delete(list); |
@@ -386,7 +387,7 @@ int cmd_buildid_cache(int argc, const char **argv, | |||
386 | continue; | 387 | continue; |
387 | } | 388 | } |
388 | pr_warning("Couldn't update %s: %s\n", | 389 | pr_warning("Couldn't update %s: %s\n", |
389 | pos->s, strerror(errno)); | 390 | pos->s, strerror_r(errno, sbuf, sizeof(sbuf))); |
390 | } | 391 | } |
391 | 392 | ||
392 | strlist__delete(list); | 393 | strlist__delete(list); |