]> sourceware.org Git - systemtap.git/commitdiff
2005-10-18 Frank Ch. Eigler <fche@redhat.com>
authorfche <fche>
Tue, 18 Oct 2005 17:59:17 +0000 (17:59 +0000)
committerfche <fche>
Tue, 18 Oct 2005 17:59:17 +0000 (17:59 +0000)
PR 1477.
* main.cxx (main): Set PATH and LC_ALL, so
* buildrun.cxx (compile_pass, run_pass): ... and ...
* translate.cxx (emit_symbol_data): ... don't have to.

ChangeLog
buildrun.cxx
main.cxx
translate.cxx

index 7aa4f71b33cc4e04d102fe4351ece21cde795936..672a2afff1e96fb40efd38e27599d3a796d4efd7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-10-18  Frank Ch. Eigler  <fche@redhat.com>
+
+       PR 1477.
+       * main.cxx (main): Set PATH and LC_ALL, so
+       * buildrun.cxx (compile_pass, run_pass): ... and ...
+       * translate.cxx (emit_symbol_data): ... don't have to.
+
 2005-10-18  Frank Ch. Eigler  <fche@elastic.org>
 
        PR 1482 cont'd.
index ca3f862a3360cdb3bab12d0ff97a93a7b3f6b567..8bc0c4bf51869894b308c7d8e5dd275b8a167a26 100644 (file)
@@ -81,7 +81,7 @@ compile_pass (systemtap_session& s)
   // Run make
   if (s.test_mode)
     {
-      string make_cmd = string("/usr/bin/make -C \"") + s.tmpdir + "\"";
+      string make_cmd = string("make -C \"") + s.tmpdir + "\"";
 
       if (! s.verbose)
         make_cmd += " -s >/dev/null 2>&1";
@@ -97,7 +97,7 @@ compile_pass (systemtap_session& s)
     {
       string module_dir = string("/lib/modules/")
         + s.kernel_release + "/build";
-      string make_cmd = string("/usr/bin/make")
+      string make_cmd = string("make")
         + string (" -C \"") + module_dir + string("\"");
       make_cmd += string(" M=\"") + s.tmpdir + string("\" modules");
 
@@ -145,7 +145,7 @@ run_pass (systemtap_session& s)
       sighandler_t oldsig = signal (SIGINT, SIG_IGN);
 
       // for now, just spawn stpd
-      string stpd_cmd = string("/usr/bin/sudo ") 
+      string stpd_cmd = string("sudo ") 
         + string(PKGLIBDIR) + "/stpd "
         + (s.bulk_mode ? "" : "-r ")
         + (s.verbose ? "" : "-q ");
index f41334252fd9a34847502523dbcdde0cdd8b9d1c..88ee9540048ac75b71ece2208b0c46922153de28 100644 (file)
--- a/main.cxx
+++ b/main.cxx
@@ -36,7 +36,7 @@ version ()
   clog
     << "SystemTap translator/driver "
     << "(version " << VERSION << " built " << DATE << ")" << endl
-    << "Copyright (C) 2005 Red Hat, Inc." << endl
+    << "Copyright (C) 2005 Red Hat, Inc. and others" << endl
     << "This is free software; see the source for copying conditions."
     << endl;
 }
@@ -251,6 +251,18 @@ main (int argc, char * const argv [])
 
   int rc = 0;
 
+  // override PATH and LC_ALL
+  char* path = "PATH=/bin:/sbin:/usr/bin:/usr/sbin"; 
+  char* lc_all = "LC_ALL=C";
+  rc = putenv (path) || putenv (lc_all);
+  if (rc)
+    {
+      const char* e = strerror (errno);
+      cerr << "setenv (\"" << path << "\" + \"" << lc_all << "\"): "
+           << e << endl;
+    }
+  
+
   // arguments parsed; get down to business
 
   // Create a temporary directory to build within.
@@ -468,7 +480,7 @@ main (int argc, char * const argv [])
         clog << "Keeping temporary directory \"" << s.tmpdir << "\"" << endl;
       else
         {
-          string cleanupcmd = "/bin/rm -rf ";
+          string cleanupcmd = "rm -rf ";
           cleanupcmd += s.tmpdir;
           if (s.verbose) clog << "Running " << cleanupcmd << endl;
          int status = system (cleanupcmd.c_str());
index 5e9621cc413a0ea331306eb03a20d7eddd5759b7..1d7ed7acbd01888b2bd674fcc09547da692c6e55 100644 (file)
@@ -2381,13 +2381,13 @@ emit_symbol_data (systemtap_session& s)
   // symbols only), a task that we defer to grep(1) and sort(1).  It
   // may be useful to cache the symbols.sorted file, perhaps indexed
   // by md5sum(/proc/modules), but let's not until this simple method
-  // proves too costly.  All that LC_ALL=C stuff is there to avoid the
+  // proves too costly.  LC_ALL=C is already set to avoid the
   // excessive penalty of i18n code in some glibc/coreutils versions.
 
   string sorted_kallsyms = s.tmpdir + "/symbols.sorted";
-  string sortcmd = "/bin/env LC_ALL=C /bin/grep \" [tT] \" /proc/kallsyms | ";
+  string sortcmd = "grep \" [tT] \" /proc/kallsyms | ";
  
-  sortcmd += "/bin/env LC_ALL=C /bin/sort ";
+  sortcmd += "sort ";
 #if __LP64__
   sortcmd += "-k 1,16 ";
 #else
This page took 0.043843 seconds and 5 git commands to generate.