summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfche <fche>2005-10-18 17:59:17 +0000
committerfche <fche>2005-10-18 17:59:17 +0000
commitce3187ac2f3f71f348fd7d4694b49c44f42337f3 (patch)
treeae3961d2c5a2f986fdc7846b4a95b2233031a462
parent2508b230c643707830bfc491c1606fe6d81bc92d (diff)
downloadsystemtap-steved-ce3187ac2f3f71f348fd7d4694b49c44f42337f3.tar.gz
systemtap-steved-ce3187ac2f3f71f348fd7d4694b49c44f42337f3.tar.xz
systemtap-steved-ce3187ac2f3f71f348fd7d4694b49c44f42337f3.zip
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.
-rw-r--r--ChangeLog7
-rw-r--r--buildrun.cxx6
-rw-r--r--main.cxx16
-rw-r--r--translate.cxx6
4 files changed, 27 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 7aa4f71b..672a2aff 100644
--- 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.
diff --git a/buildrun.cxx b/buildrun.cxx
index ca3f862a..8bc0c4bf 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -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 ");
diff --git a/main.cxx b/main.cxx
index f4133425..88ee9540 100644
--- 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());
diff --git a/translate.cxx b/translate.cxx
index 5e9621cc..1d7ed7ac 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -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