зеркало из https://github.com/mozilla/pjs.git
Fix bug 110807, newlines on win32 trace-malloc tools
sr=brendan,r=dbaron NOT in normal build
This commit is contained in:
Родитель
7a8c16063f
Коммит
4d6ff15219
|
@ -1501,7 +1501,7 @@ static const char SDLOG_OPTION[] = "--shutdown-leaks";
|
|||
|
||||
PR_IMPLEMENT(int) NS_TraceMallocStartupArgs(int argc, char* argv[])
|
||||
{
|
||||
int i, logfd = -1, consumed;
|
||||
int i, logfd = -1, consumed, logflags;
|
||||
char *tmlogname = NULL; /* note global |sdlogname| */
|
||||
|
||||
/*
|
||||
|
@ -1594,7 +1594,14 @@ PR_IMPLEMENT(int) NS_TraceMallocStartupArgs(int argc, char* argv[])
|
|||
/* FALL THROUGH */
|
||||
|
||||
default:
|
||||
logfd = open(tmlogname, O_CREAT | O_WRONLY | O_TRUNC, 0644);
|
||||
logflags = O_CREAT | O_WRONLY | O_TRUNC;
|
||||
#if defined(XP_WIN32)
|
||||
/*
|
||||
* Avoid translations on WIN32.
|
||||
*/
|
||||
logflags |= O_BINARY;
|
||||
#endif
|
||||
logfd = open(tmlogname, logflags, 0644);
|
||||
if (logfd < 0) {
|
||||
fprintf(stderr,
|
||||
"%s: can't create trace-malloc log named %s: %s\n",
|
||||
|
|
|
@ -372,7 +372,11 @@ int tmreader_eventloop(tmreader *tmr, const char *filename,
|
|||
if (strcmp(filename, "-") == 0) {
|
||||
fp = stdin;
|
||||
} else {
|
||||
#if defined(XP_WIN32)
|
||||
fp = fopen(filename, "rb");
|
||||
#else
|
||||
fp = fopen(filename, "r");
|
||||
#endif
|
||||
if (!fp) {
|
||||
fprintf(stderr, "%s: can't open %s: %s.\n",
|
||||
tmr->program, filename, strerror(errno));
|
||||
|
|
|
@ -1501,7 +1501,7 @@ static const char SDLOG_OPTION[] = "--shutdown-leaks";
|
|||
|
||||
PR_IMPLEMENT(int) NS_TraceMallocStartupArgs(int argc, char* argv[])
|
||||
{
|
||||
int i, logfd = -1, consumed;
|
||||
int i, logfd = -1, consumed, logflags;
|
||||
char *tmlogname = NULL; /* note global |sdlogname| */
|
||||
|
||||
/*
|
||||
|
@ -1594,7 +1594,14 @@ PR_IMPLEMENT(int) NS_TraceMallocStartupArgs(int argc, char* argv[])
|
|||
/* FALL THROUGH */
|
||||
|
||||
default:
|
||||
logfd = open(tmlogname, O_CREAT | O_WRONLY | O_TRUNC, 0644);
|
||||
logflags = O_CREAT | O_WRONLY | O_TRUNC;
|
||||
#if defined(XP_WIN32)
|
||||
/*
|
||||
* Avoid translations on WIN32.
|
||||
*/
|
||||
logflags |= O_BINARY;
|
||||
#endif
|
||||
logfd = open(tmlogname, logflags, 0644);
|
||||
if (logfd < 0) {
|
||||
fprintf(stderr,
|
||||
"%s: can't create trace-malloc log named %s: %s\n",
|
||||
|
|
Загрузка…
Ссылка в новой задаче