From: fche Date: Tue, 18 Oct 2005 17:59:17 +0000 (+0000) Subject: 2005-10-18 Frank Ch. Eigler X-Git-Tag: release-0.5~108 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=ce3187ac2f3f71f348fd7d4694b49c44f42337f3;p=systemtap.git 2005-10-18 Frank Ch. Eigler 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. --- diff --git a/ChangeLog b/ChangeLog index 7aa4f71b3..672a2afff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-10-18 Frank Ch. Eigler + + 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 PR 1482 cont'd. diff --git a/buildrun.cxx b/buildrun.cxx index ca3f862a3..8bc0c4bf5 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 f41334252..88ee95400 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 5e9621cc4..1d7ed7acb 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