summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-09-21 22:35:17 +0200
committerTim Moore <timoore@redhat.com>2009-09-30 20:40:30 +0200
commit735d2a19eac533188e96a578142c0ec0d1311fdb (patch)
tree3d7905eed384c917a632d1f3b49df51da62082f0
parent6248dea71308a565d4b7b11384356e1419e9e52d (diff)
downloadsystemtap-steved-735d2a19eac533188e96a578142c0ec0d1311fdb.tar.gz
systemtap-steved-735d2a19eac533188e96a578142c0ec0d1311fdb.tar.xz
systemtap-steved-735d2a19eac533188e96a578142c0ec0d1311fdb.zip
Pass command line arguments on to stap
* grapher/grapher.cxx (main): Pass program arguments to stap
-rw-r--r--grapher/grapher.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/grapher/grapher.cxx b/grapher/grapher.cxx
index 82e103f3..82f60b79 100644
--- a/grapher/grapher.cxx
+++ b/grapher/grapher.cxx
@@ -4,6 +4,7 @@
#include <cerrno>
#include <cmath>
#include <cstdio>
+#include <cstring>
#include <iostream>
#include <sstream>
#include <string>
@@ -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<char*>(0));
+ char argv0[] = "stap";
+ argv[0] = argv0;
+ execvp("stap", argv);
exit(1);
return 1;
}