[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-bozcszy93tpgw9ad6qm3dhpx@git.kernel.org>
Date: Wed, 13 Jul 2016 00:14:08 -0700
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: dsahern@...il.com, namhyung@...nel.org, rostedt@...dmis.org,
linux-kernel@...r.kernel.org, adrian.hunter@...el.com,
jolsa@...nel.org, jpoimboe@...hat.com, mingo@...nel.org,
tglx@...utronix.de, hpa@...or.com, wangnan0@...wei.com,
acme@...hat.com
Subject: [tip:perf/core] tools lib subcmd: Use str_error_r()
Commit-ID: 07eebccbca2c21f32b5142f1a55b3b6818c54116
Gitweb: http://git.kernel.org/tip/07eebccbca2c21f32b5142f1a55b3b6818c54116
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Fri, 8 Jul 2016 15:26:50 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 12 Jul 2016 15:20:30 -0300
tools lib subcmd: Use str_error_r()
To make it portable to non-glibc systems, that follow the XSI variant
instead of the GNU specific one that gets in place when _GNU_SOURCE is
defined.
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-bozcszy93tpgw9ad6qm3dhpx@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/lib/subcmd/run-command.c | 5 +++--
tools/objtool/Build | 5 +++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/tools/lib/subcmd/run-command.c b/tools/lib/subcmd/run-command.c
index f4f6c9e..911f839 100644
--- a/tools/lib/subcmd/run-command.c
+++ b/tools/lib/subcmd/run-command.c
@@ -3,6 +3,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
+#include <linux/string.h>
#include <errno.h>
#include <sys/wait.h>
#include "subcmd-util.h"
@@ -109,7 +110,7 @@ int start_command(struct child_process *cmd)
if (cmd->dir && chdir(cmd->dir))
die("exec %s: cd to %s failed (%s)", cmd->argv[0],
- cmd->dir, strerror_r(errno, sbuf, sizeof(sbuf)));
+ cmd->dir, str_error_r(errno, sbuf, sizeof(sbuf)));
if (cmd->env) {
for (; *cmd->env; cmd->env++) {
if (strchr(*cmd->env, '='))
@@ -173,7 +174,7 @@ static int wait_or_whine(pid_t pid)
if (errno == EINTR)
continue;
fprintf(stderr, " Error: waitpid failed (%s)",
- strerror_r(errno, sbuf, sizeof(sbuf)));
+ str_error_r(errno, sbuf, sizeof(sbuf)));
return -ERR_RUN_COMMAND_WAITPID;
}
if (waiting != pid)
diff --git a/tools/objtool/Build b/tools/objtool/Build
index 0e89258..2457916 100644
--- a/tools/objtool/Build
+++ b/tools/objtool/Build
@@ -5,9 +5,14 @@ objtool-y += special.o
objtool-y += objtool.o
objtool-y += libstring.o
+objtool-y += str_error_r.o
CFLAGS += -I$(srctree)/tools/lib
$(OUTPUT)libstring.o: ../lib/string.c FORCE
$(call rule_mkdir)
$(call if_changed_dep,cc_o_c)
+
+$(OUTPUT)str_error_r.o: ../lib/str_error_r.c FORCE
+ $(call rule_mkdir)
+ $(call if_changed_dep,cc_o_c)
Powered by blists - more mailing lists