| OLD | NEW |
| 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 | 2 |
| 3 /* This Source Code Form is subject to the terms of the Mozilla Public | 3 /* This Source Code Form is subject to the terms of the Mozilla Public |
| 4 * License, v. 2.0. If a copy of the MPL was not distributed with this | 4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 6 | 6 |
| 7 #include "primpl.h" | 7 #include "primpl.h" |
| 8 #include "prenv.h" | 8 #include "prenv.h" |
| 9 #include "prprf.h" | 9 #include "prprf.h" |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 lm = lm->next; | 231 lm = lm->next; |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 /*found:*/ | 234 /*found:*/ |
| 235 count = sscanf(&ev[pos], " , %n", &delta); | 235 count = sscanf(&ev[pos], " , %n", &delta); |
| 236 pos += delta; | 236 pos += delta; |
| 237 if (count == EOF) break; | 237 if (count == EOF) break; |
| 238 } | 238 } |
| 239 PR_SetLogBuffering(isSync ? 0 : bufSize); | 239 PR_SetLogBuffering(isSync ? 0 : bufSize); |
| 240 | 240 |
| 241 #ifdef XP_UNIX | 241 ev = PR_GetEnvSecure("NSPR_LOG_FILE"); |
| 242 if ((getuid() != geteuid()) || (getgid() != getegid())) { | |
| 243 return; | |
| 244 } | |
| 245 #endif /* XP_UNIX */ | |
| 246 | |
| 247 ev = PR_GetEnv("NSPR_LOG_FILE"); | |
| 248 if (ev && ev[0]) { | 242 if (ev && ev[0]) { |
| 249 if (!PR_SetLogFile(ev)) { | 243 if (!PR_SetLogFile(ev)) { |
| 250 #ifdef XP_PC | 244 #ifdef XP_PC |
| 251 char* str = PR_smprintf("Unable to create nspr log file '%s'\n",
ev); | 245 char* str = PR_smprintf("Unable to create nspr log file '%s'\n",
ev); |
| 252 if (str) { | 246 if (str) { |
| 253 OutputDebugStringA(str); | 247 OutputDebugStringA(str); |
| 254 PR_smprintf_free(str); | 248 PR_smprintf_free(str); |
| 255 } | 249 } |
| 256 #else | 250 #else |
| 257 fprintf(stderr, "Unable to create nspr log file '%s'\n", ev); | 251 fprintf(stderr, "Unable to create nspr log file '%s'\n", ev); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 #ifdef WIN32 | 545 #ifdef WIN32 |
| 552 DebugBreak(); | 546 DebugBreak(); |
| 553 #elif defined(XP_OS2) | 547 #elif defined(XP_OS2) |
| 554 asm("int $3"); | 548 asm("int $3"); |
| 555 #elif defined(ANDROID) | 549 #elif defined(ANDROID) |
| 556 __android_log_assert(NULL, "PRLog", "Assertion failure: %s, at %s:%d\n", | 550 __android_log_assert(NULL, "PRLog", "Assertion failure: %s, at %s:%d\n", |
| 557 s, file, ln); | 551 s, file, ln); |
| 558 #endif | 552 #endif |
| 559 abort(); | 553 abort(); |
| 560 } | 554 } |
| OLD | NEW |