From ce3187ac2f3f71f348fd7d4694b49c44f42337f3 Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 18 Oct 2005 17:59:17 +0000 Subject: 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. --- main.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'main.cxx') 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()); -- cgit