But 535564 part 3 - don't inherit leak/bloat log handles from parent to child processes on Windows: the Java plugin spawns a process which can remain after our Firefox/plugin processes are properly cleaned up, preventing the log files from being closed, r=jgriffin over IRC

--HG--
extra : rebase_source : 413e125c087f8e8c37f9f3dec372521e709760e5
This commit is contained in:
Benjamin Smedberg 2010-01-27 11:19:50 -05:00
parent 226e0ab87f
commit d62f1fe600

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",