Kai Liu 958b9c80e1 Avoid global static initialization in Env::Default()
Summary:
Mark's task description from #2316777

Env::Default() comes from util/env_posix.cc

This is a static global.

static PosixEnv default_env;

Env* Env::Default() {
  return &default_env;
}

-----

These globals assume default_env was initialized first. I don't think that is safe or correct to do (http://stackoverflow.com/questions/1005685/c-static-initialization-order)

const string AutoRollLoggerTest::kTestDir(
test::TmpDir() + "/db_log_test");
const string AutoRollLoggerTest::kLogFile(
test::TmpDir() + "/db_log_test/LOG");
Env* AutoRollLoggerTest::env = Env::Default();

Test Plan:
run make clean && make && make check
But how can I know if it works in Ubuntu?

Reviewers: MarkCallaghan, chip

Reviewed By: chip

CC: leveldb, dhruba, haobo

Differential Revision: https://reviews.facebook.net/D10491
2013-04-22 18:10:28 -07:00
..
2013-02-28 18:04:58 -08:00
2011-10-31 17:22:06 +00:00
2012-11-28 17:18:41 -08:00
2013-02-28 18:04:58 -08:00
2013-02-28 18:04:58 -08:00
2013-02-28 18:04:58 -08:00
2012-08-28 11:43:33 -07:00
2013-02-28 18:04:58 -08:00
2011-10-31 17:22:06 +00:00
2012-04-17 08:36:46 -07:00
2011-10-31 17:22:06 +00:00
2011-10-31 17:22:06 +00:00
2013-04-10 14:44:06 -07:00
2011-10-31 17:22:06 +00:00
2013-04-20 10:26:51 -07:00
2013-02-28 18:04:58 -08:00
2013-03-27 11:27:39 -07:00
2013-02-28 18:04:58 -08:00
2011-10-31 17:22:06 +00:00