提交 340481ad 编写于 作者: M Masami Hiramatsu 提交者: Arnaldo Carvalho de Melo

perf buildid-cache: Use strerror_r instead of strerror

Use strerror_r instead of strerror in error messages for thread-safety.
Signed-off-by: NMasami 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.novalocalSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 fb74fbda
......@@ -291,6 +291,7 @@ int cmd_buildid_cache(int argc, const char **argv,
*missing_filename = NULL,
*update_name_list_str = NULL,
*kcore_filename;
char sbuf[STRERR_BUFSIZE];
struct perf_data_file file = {
.mode = PERF_DATA_MODE_READ,
......@@ -347,7 +348,7 @@ int cmd_buildid_cache(int argc, const char **argv,
continue;
}
pr_warning("Couldn't add %s: %s\n",
pos->s, strerror(errno));
pos->s, strerror_r(errno, sbuf, sizeof(sbuf)));
}
strlist__delete(list);
......@@ -365,7 +366,7 @@ int cmd_buildid_cache(int argc, const char **argv,
continue;
}
pr_warning("Couldn't remove %s: %s\n",
pos->s, strerror(errno));
pos->s, strerror_r(errno, sbuf, sizeof(sbuf)));
}
strlist__delete(list);
......@@ -386,7 +387,7 @@ int cmd_buildid_cache(int argc, const char **argv,
continue;
}
pr_warning("Couldn't update %s: %s\n",
pos->s, strerror(errno));
pos->s, strerror_r(errno, sbuf, sizeof(sbuf)));
}
strlist__delete(list);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册