summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorRichard Linden <none@none>2011-03-18 11:42:39 -0700
committerRichard Linden <none@none>2011-03-18 11:42:39 -0700
commit097e076a7221f8b25914f1fad61e27ac316915e5 (patch)
tree8a57fcda493436d53a8f783a3d874ce39a093f6e /indra/llcommon
parentf64a20ddcff91677b02b7688e08819cffb0989c9 (diff)
parente5a4b145b435396aa2c0d3d9a49019984658cdf4 (diff)
Automated merge with bundle:F:\code\viewer-social+c:\users\richard\appdata\local\temp\thg.yibew7\http__hg.secondlife.com_viewer-development_t3uwtb.hg
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llprocesslauncher.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/indra/llcommon/llprocesslauncher.cpp b/indra/llcommon/llprocesslauncher.cpp
index d46188104f..10950181fd 100644
--- a/indra/llcommon/llprocesslauncher.cpp
+++ b/indra/llcommon/llprocesslauncher.cpp
@@ -103,10 +103,30 @@ int LLProcessLauncher::launch(void)
char *args2 = new char[args.size() + 1];
strcpy(args2, args.c_str());
- if( ! CreateProcessA( NULL, args2, NULL, NULL, FALSE, 0, NULL, mWorkingDir.c_str(), &sinfo, &pinfo ) )
+ const char * working_directory = 0;
+ if(!mWorkingDir.empty()) working_directory = mWorkingDir.c_str();
+ if( ! CreateProcessA( NULL, args2, NULL, NULL, FALSE, 0, NULL, working_directory, &sinfo, &pinfo ) )
{
- // TODO: do better than returning the OS-specific error code on failure...
result = GetLastError();
+
+ LPTSTR error_str = 0;
+ if(
+ FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL,
+ result,
+ 0,
+ (LPTSTR)&error_str,
+ 0,
+ NULL)
+ != 0)
+ {
+ char message[256];
+ wcstombs(message, error_str, 256);
+ message[255] = 0;
+ llwarns << "CreateProcessA failed: " << message << llendl;
+ LocalFree(error_str);
+ }
+
if(result == 0)
{
// Make absolutely certain we return a non-zero value on failure.