install a larger buffer for stdout. This ensures that

log information from different scheduler requests running
in parallel don't collide in the log file and appear
intermingled. Very useful when doing verbose debugging.

svn path=/trunk/boinc/; revision=5069
This commit is contained in:
Bruce Allen 2005-01-11 02:38:15 +00:00
parent 1cc53bd7d5
commit 8addf5b6f9
1 changed files with 11 additions and 0 deletions

View File

@ -97,6 +97,7 @@ int main() {
unsigned int counter=0; unsigned int counter=0;
char* code_sign_key; char* code_sign_key;
bool project_stopped = false; bool project_stopped = false;
char *stderr_buffer;
#ifndef _USING_FCGI_ #ifndef _USING_FCGI_
get_log_path(path, "cgi.log"); get_log_path(path, "cgi.log");
@ -106,6 +107,16 @@ int main() {
send_message(buf, 3600); send_message(buf, 3600);
exit(0); exit(0);
} }
// install a larger buffer for stderr. This ensures that
// log information from different scheduler requests running
// in parallel don't collide in the log file and appear
// intermingled.
//
if (!(stderr_buffer=(char *)malloc(32768)) || setvbuf(stderr, stderr_buffer, _IOFBF, 32768)) {
log_messages.printf(SCHED_MSG_LOG::CRITICAL,
"Unable to change stderr buffering preferences\n"
);
}
#endif #endif
srand(time(0)+getpid()); srand(time(0)+getpid());