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@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.
// 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";
{
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");
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 ");
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;
}
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.
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());
// 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