From 735d2a19eac533188e96a578142c0ec0d1311fdb Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Mon, 21 Sep 2009 22:35:17 +0200 Subject: [PATCH] Pass command line arguments on to stap * grapher/grapher.cxx (main): Pass program arguments to stap --- grapher/grapher.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/grapher/grapher.cxx b/grapher/grapher.cxx index 82e103f3f..82f60b799 100644 --- a/grapher/grapher.cxx +++ b/grapher/grapher.cxx @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -102,8 +103,9 @@ extern "C" void handleChild(int signum, siginfo_t* info, void* context) { char buf[1]; + ssize_t err; buf[0] = 1; - ssize_t err = write(signalPipe[1], buf, 1); + err = write(signalPipe[1], buf, 1); } } @@ -184,8 +186,9 @@ int main(int argc, char** argv) dup2(pipefd[3], STDERR_FILENO); for (int i = 0; i < 4; ++i) close(pipefd[i]); - - execlp("stap", "stap", argv[1], static_cast(0)); + char argv0[] = "stap"; + argv[0] = argv0; + execvp("stap", argv); exit(1); return 1; } -- 2.43.5