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
Родитель b3c5c7f364
Коммит 960011b6e2
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

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