LIB: Get rid of the spurious 'dyld: DYLD_ environment variables being ignored' stderr messages on Mac OS X 10.8 machines across all of our apps.

This commit is contained in:
Rom Walton 2014-07-03 12:10:28 -04:00
parent 572d7bf9e5
commit 87d3cb5474
1 changed files with 16 additions and 1 deletions

View File

@ -52,6 +52,7 @@ int procinfo_setup(PROC_MAP& pm) {
char* lf; char* lf;
static long iBrandID = -1; static long iBrandID = -1;
int priority; int priority;
char env1[1024], env2[1024];
if (iBrandID < 0) { if (iBrandID < 0) {
iBrandID = BOINC_BRAND_ID; iBrandID = BOINC_BRAND_ID;
@ -65,6 +66,14 @@ int procinfo_setup(PROC_MAP& pm) {
} }
} }
// Temporarily remove some environment vraiables which cause 'ps' to write
// some stuff to stderr on 10.8
//
safe_strcpy(getenv("DYLD_LIBRARY_PATH"), env1);
safe_strcpy(getenv("LD_LIBRARY_PATH"), env2);
unsetenv("DYLD_LIBRARY_PATH");
unsetenv("LD_LIBRARY_PATH");
#if SHOW_TIMING #if SHOW_TIMING
UnsignedWide start, end, elapsed; UnsignedWide start, end, elapsed;
@ -165,5 +174,11 @@ int procinfo_setup(PROC_MAP& pm) {
#endif #endif
find_children(pm); find_children(pm);
// Put back the environment variables previously removed
//
setenv("DYLD_LIBRARY_PATH", env1, 1);
setenv("LD_LIBRARY_PATH", env2, 1);
return 0; return 0;
} }