diff options
author | Billy Donahue <billy.donahue@mongodb.com> | 2020-06-03 13:51:01 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-06-11 01:11:50 +0000 |
commit | c08a726e61157ae501c28cf7e222e16d49954fbf (patch) | |
tree | 50e0cdc58f93a42dcba3a594051f9def44c457b8 /src/mongo/tools | |
parent | f664f948ad0876f0537958cb5ab29a857f1e4924 (diff) | |
download | mongo-c08a726e61157ae501c28cf7e222e16d49954fbf.tar.gz |
SERVER-48367 Remove all _envp usage
Diffstat (limited to 'src/mongo/tools')
-rw-r--r-- | src/mongo/tools/bridge.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mongo/tools/bridge.cpp b/src/mongo/tools/bridge.cpp index 52336902ba7..e377fae9be8 100644 --- a/src/mongo/tools/bridge.cpp +++ b/src/mongo/tools/bridge.cpp @@ -453,7 +453,7 @@ DbResponse ServiceEntryPointBridge::handleRequest(OperationContext* opCtx, const } } -int bridgeMain(int argc, char** argv, char** envp) { +int bridgeMain(int argc, char** argv) { registerShutdownTask([&] { // NOTE: This function may be called at any time. It must not @@ -472,7 +472,7 @@ int bridgeMain(int argc, char** argv, char** envp) { }); setupSignalHandlers(); - runGlobalInitializersOrDie(argc, argv, envp); + runGlobalInitializersOrDie(std::vector<std::string>(argv, argv + argc)); startSignalProcessingThread(LogFileStatus::kNoLogFileToRotate); setGlobalServiceContext(ServiceContext::make()); @@ -512,14 +512,11 @@ int bridgeMain(int argc, char** argv, char** envp) { // WindowsCommandLine object converts these wide character strings to a UTF-8 coded equivalent // and makes them available through the argv() and envp() members. This enables bridgeMain() // to process UTF-8 encoded arguments and environment variables without regard to platform. -int wmain(int argc, wchar_t* argvW[], wchar_t* envpW[]) { - mongo::WindowsCommandLine wcl(argc, argvW, envpW); - int exitCode = mongo::bridgeMain(argc, wcl.argv(), wcl.envp()); - mongo::quickExit(exitCode); +int wmain(int argc, wchar_t* argvW[]) { + mongo::quickExit(mongo::bridgeMain(argc, mongo::WindowsCommandLine(argc, argvW).argv())); } #else -int main(int argc, char* argv[], char** envp) { - int exitCode = mongo::bridgeMain(argc, argv, envp); - mongo::quickExit(exitCode); +int main(int argc, char* argv[]) { + mongo::quickExit(mongo::bridgeMain(argc, argv)); } #endif |