Skip to content
Snippets Groups Projects
Commit 08f52326 authored by rswindell's avatar rswindell
Browse files

Added '-f' option to force console output stream to non-buffered.

parent ee4a6742
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -100,6 +100,7 @@ void usage(FILE* fp)
"\t-h[hostname] use local or specified host name (instead of SCFG value)\n"
"\t-L<mask> set log level mask (default=0x%x)\n"
"\t-E<level> set error log level threshold (default=%d)\n"
"\t-f use non-buffered stream for console messages\n"
"\t-a append instead of overwriting message output files\n"
"\t-e<filename> send error messages to file in addition to stderr\n"
"\t-o<filename> send console messages to file instead of stdout\n"
......@@ -745,6 +746,7 @@ int main(int argc, char **argv, char** environ)
int argn;
long result;
BOOL loop=FALSE;
BOOL nonbuffered_con=FALSE;
confp=stdout;
errfp=stderr;
......@@ -777,6 +779,9 @@ int main(int argc, char **argv, char** environ)
case 'a':
omode="a";
break;
case 'f':
nonbuffered_con=TRUE;
break;
case 'm':
if(*p==0) p=argv[++argn];
js_max_bytes=strtoul(p,NULL,0);
......@@ -911,6 +916,9 @@ int main(int argc, char **argv, char** environ)
/* Don't cache error log */
setvbuf(errfp,NULL,_IONBF,0);
if(nonbuffered_con)
setvbuf(confp,NULL,_IONBF,0);
/* Install Ctrl-C/Break signal handler here */
#if defined(_WIN32)
SetConsoleCtrlHandler(ControlHandler, TRUE /* Add */);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment