Bug 714286 followup - Fix the temp path detection code for Windows; r=mccr8

This commit is contained in:
Ehsan Akhgari 2012-01-03 22:53:30 -05:00
parent 0bcdb4be05
commit 0b39385507

View File

@ -1401,11 +1401,17 @@ public:
NS_IMETHOD Begin()
{
char name[MAXPATHLEN] = {'\0'};
#ifdef XP_WIN
// On Windows, tmpnam returns useless stuff, such as "\\s164.".
// Therefore we need to call the APIs directly.
GetTempPathA(mozilla::ArrayLength(name), name);
#else
tmpnam(name);
char *lastSlash = strrchr(name, XPCOM_FILE_PATH_SEPARATOR[0]);
if (lastSlash) {
*lastSlash = '\0';
}
#endif
sprintf(name, "%s%scc-edges-%d.%d.log", name,
XPCOM_FILE_PATH_SEPARATOR,
++gLogCounter, base::GetCurrentProcId());