diff options
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/llprocesslauncher.cpp | 20 | ||||
-rw-r--r-- | indra/llcommon/llprocesslauncher.h | 4 |
2 files changed, 14 insertions, 10 deletions
diff --git a/indra/llcommon/llprocesslauncher.cpp b/indra/llcommon/llprocesslauncher.cpp index 10950181fd..25d64e9e28 100644 --- a/indra/llcommon/llprocesslauncher.cpp +++ b/indra/llcommon/llprocesslauncher.cpp @@ -73,11 +73,6 @@ void LLProcessLauncher::addArgument(const std::string &arg) mLaunchArguments.push_back(arg); } -void LLProcessLauncher::addArgument(const char *arg) -{ - mLaunchArguments.push_back(std::string(arg)); -} - #if LL_WINDOWS int LLProcessLauncher::launch(void) @@ -262,12 +257,19 @@ int LLProcessLauncher::launch(void) if(id == 0) { // child process - ::execv(mExecutable.c_str(), (char * const *)fake_argv); - + // If we reach this point, the exec failed. - // Use _exit() instead of exit() per the vfork man page. - _exit(0); + LL_WARNS("LLProcessLauncher") << "failed to launch: "; + for (const char * const * ai = fake_argv; *ai; ++ai) + { + LL_CONT << *ai << ' '; + } + LL_CONT << LL_ENDL; + // Use _exit() instead of exit() per the vfork man page. Exit with a + // distinctive rc: someday soon we'll be able to retrieve it, and it + // would be nice to be able to tell that the child process failed! + _exit(249); } // parent process diff --git a/indra/llcommon/llprocesslauncher.h b/indra/llcommon/llprocesslauncher.h index 954c249147..1daa980c58 100644 --- a/indra/llcommon/llprocesslauncher.h +++ b/indra/llcommon/llprocesslauncher.h @@ -28,6 +28,7 @@ #define LL_LLPROCESSLAUNCHER_H #if LL_WINDOWS +#define WIN32_LEAN_AND_MEAN #include <windows.h> #endif @@ -51,7 +52,6 @@ public: void clearArguments(); void addArgument(const std::string &arg); - void addArgument(const char *arg); int launch(void); bool isRunning(void); @@ -66,10 +66,12 @@ public: void orphan(void); // This needs to be called periodically on Mac/Linux to clean up zombie processes. + // (However, as of 2012-01-12 there are no such calls in the viewer code base. :-P ) static void reap(void); // Accessors for platform-specific process ID #if LL_WINDOWS + // (Windows flavor unused as of 2012-01-12) HANDLE getProcessHandle() { return mProcessHandle; }; #else pid_t getProcessID() { return mProcessID; }; |