]> sourceware.org Git - systemtap.git/commitdiff
Pass command line arguments on to stap
authorTim Moore <timoore@redhat.com>
Mon, 21 Sep 2009 20:35:17 +0000 (22:35 +0200)
committerTim Moore <timoore@redhat.com>
Wed, 30 Sep 2009 18:40:30 +0000 (20:40 +0200)
* grapher/grapher.cxx (main): Pass program arguments to stap

grapher/grapher.cxx

index 82e103f3f9c57ec5ed5ef1975a4981297c309e95..82f60b79915f8314d3043a8761ce5f1448a701bb 100644 (file)
@@ -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;
         }
This page took 0.030069 seconds and 5 git commands to generate.