Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #869 from EOSIO/launcher-bugfix-250
Browse files Browse the repository at this point in the history
STAT 247 - Remove shadowed variable in launcher.
  • Loading branch information
heifner authored Dec 6, 2017
2 parents 4f78575 + fe2ae29 commit fbdc913
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions programs/launcher/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ launcher_def::initialize (const variables_map &vmap) {
system_clock::time_point now = system_clock::now();
std::time_t now_c = system_clock::to_time_t(now);
ostringstream dstrm;
dstrm << std::put_time(std::localtime(&now_c), "%Y_%m_%d_%H_%M_%S") << ends;
dstrm << std::put_time(std::localtime(&now_c), "%Y_%m_%d_%H_%M_%S");
launch_time = dstrm.str();

if ( ! (shape.empty() ||
Expand Down Expand Up @@ -458,10 +458,17 @@ launcher_def::initialize (const variables_map &vmap) {
if (prod_nodes > total_nodes)
total_nodes = prod_nodes;

char * erd = getenv ("EOS_ROOT_DIR");
if (erd == 0) {
erd = getenv ("PWD");
char* erd_env_var = getenv ("EOS_ROOT_DIR");
if (erd_env_var == nullptr || std::string(erd_env_var).empty()) {
erd_env_var = getenv ("PWD");
}

if (erd_env_var != nullptr) {
erd = erd_env_var;
} else {
erd.clear();
}

stage = bf::path(erd);
if (!bf::exists(stage)) {
cerr << erd << " is not a valid path" << endl;
Expand Down

0 comments on commit fbdc913

Please sign in to comment.