aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/run-command.c
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2015-12-15 09:39:38 -0600
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-12-17 14:27:10 -0300
commit2f4ce5ec1d447beb42143a9653716a2ab025161e (patch)
tree97c7c5342f217383a7fefc579ad16f8da62bb6a2 /tools/perf/util/run-command.c
parentperf tools: Remove 'perf' from subcmd function and variable names (diff)
downloadlinux-dev-2f4ce5ec1d447beb42143a9653716a2ab025161e.tar.xz
linux-dev-2f4ce5ec1d447beb42143a9653716a2ab025161e.zip
perf tools: Finalize subcmd independence
For the files that will be moved to the subcmd library, remove all their perf-specific includes and duplicate any needed functionality. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/6e12946f0f26ce4d543d34db68d9dae3c8551cb9.1450193761.git.jpoimboe@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/run-command.c')
-rw-r--r--tools/perf/util/run-command.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/perf/util/run-command.c b/tools/perf/util/run-command.c
index 910c0f6479f4..fed37d6ae070 100644
--- a/tools/perf/util/run-command.c
+++ b/tools/perf/util/run-command.c
@@ -1,7 +1,15 @@
-#include "cache.h"
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/wait.h>
+#include "subcmd-util.h"
#include "run-command.h"
#include "exec_cmd.h"
-#include "debug.h"
+
+#define STRERR_BUFSIZE 128
static inline void close_pair(int fd[2])
{
@@ -164,8 +172,8 @@ static int wait_or_whine(pid_t pid)
if (waiting < 0) {
if (errno == EINTR)
continue;
- error("waitpid failed (%s)",
- strerror_r(errno, sbuf, sizeof(sbuf)));
+ fprintf(stderr, " Error: waitpid failed (%s)",
+ strerror_r(errno, sbuf, sizeof(sbuf)));
return -ERR_RUN_COMMAND_WAITPID;
}
if (waiting != pid)