Issue #1319 - Remove stderr_to_file.

This local-debug function is only useful for Android to work around
issues with logspewing and should never be in production builds anyway.
This commit is contained in:
wolfbeast 2020-01-14 13:23:39 +01:00 committed by Roy Tam
commit d28c0b15a6
2 changed files with 0 additions and 51 deletions

View file

@ -321,30 +321,6 @@ set_stderr_callback(StderrCallback aCallback)
sStderrCallback = aCallback;
}
#if defined(ANDROID) && !defined(RELEASE_OR_BETA)
static FILE* sStderrCopy = nullptr;
void
stderr_to_file(const char* aFmt, va_list aArgs)
{
vfprintf(sStderrCopy, aFmt, aArgs);
}
void
copy_stderr_to_file(const char* aFile)
{
if (sStderrCopy) {
return;
}
size_t buflen = strlen(aFile) + 16;
char* buf = (char*)malloc(buflen);
snprintf(buf, buflen, "%s.%u", aFile, (uint32_t)getpid());
sStderrCopy = fopen(buf, "w");
free(buf);
set_stderr_callback(stderr_to_file);
}
#endif
#ifdef HAVE_VA_COPY
#define VARARGS_ASSIGN(foo, bar) VA_COPY(foo,bar)
#elif defined(HAVE_VA_LIST_AS_ARRAY)