Bug 535564 yet another attempt - Don't inherit the leak log handle from parent to child processes: Java spawns a process which holds this handle alive beyond our shutdown, causing our test harnesses to be unable to delete it, r?jgriffin

This commit is contained in:
Benjamin Smedberg 2010-01-26 15:50:53 -05:00
parent cdf47037d7
commit aebc8a52c7

View File

@ -620,6 +620,12 @@ static PRBool LogThisObj(PRInt32 aSerialNumber)
return nsnull != PL_HashTableLookup(gObjectsToLog, (const void*)(aSerialNumber));
}
#ifdef XP_WIN
#define FOPEN_NO_INHERIT "N"
#else
#define FOPEN_NO_INHERIT
#endif
static PRBool InitLog(const char* envVar, const char* msg, FILE* *result)
{
const char* value = getenv(envVar);
@ -653,7 +659,7 @@ static PRBool InitLog(const char* envVar, const char* msg, FILE* *result)
fname.AppendLiteral(".log");
}
#endif
stream = ::fopen(fname.get(), "w");
stream = ::fopen(fname.get(), "w" FOPEN_NO_INHERIT);
if (stream != NULL) {
*result = stream;
fprintf(stdout, "### %s defined -- logging %s to %s\n",