From: Tim Moore Date: Mon, 21 Sep 2009 20:35:17 +0000 (+0200) Subject: Pass command line arguments on to stap X-Git-Tag: release-1.0.9~147 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=735d2a19eac533188e96a578142c0ec0d1311fdb;p=systemtap.git Pass command line arguments on to stap * grapher/grapher.cxx (main): Pass program arguments to stap --- 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; }