Revision 6731132f
Added by Hamish Coleman almost 17 years ago
- ID 6731132f68d3e0d682da52944a6c9c1bdb76482d
| wconsd.c | ||
|---|---|---|
|
SERVICE_STATUS wconsd_status;
|
||
|
SERVICE_STATUS_HANDLE wconsd_statusHandle;
|
||
|
|
||
|
int debug_mode = 0;
|
||
|
|
||
|
/* these match the official telnet codes */
|
||
|
#define TELNET_OPTION_SB 0xfa
|
||
| ... | ... | |
|
* log a debug message
|
||
|
*/
|
||
|
int dprintf_level = 1;
|
||
|
int dprintf_to_stdout = 0;
|
||
|
int dprintf(unsigned char severity, const char *fmt, ...) {
|
||
|
va_list args;
|
||
|
char buf[MAXLEN];
|
||
| ... | ... | |
|
i=vsnprintf(buf,sizeof(buf),fmt,args);
|
||
|
va_end(args);
|
||
|
|
||
|
if (debug_mode) {
|
||
|
if (dprintf_to_stdout) {
|
||
|
printf("%s",buf);
|
||
|
} else {
|
||
|
OutputDebugStringA(buf);
|
||
| ... | ... | |
|
if (argc==1 || argc==0) {
|
||
|
|
||
|
// assume that our messages are going to the debug log
|
||
|
debug_mode=0;
|
||
|
dprintf_to_stdout=0;
|
||
|
|
||
|
if (SCM_Start(&sd)!=SVC_CONSOLE) {
|
||
|
return 0;
|
||
| ... | ... | |
|
}
|
||
|
|
||
|
// We are running in debug mode (or any other command-line mode)
|
||
|
debug_mode=1;
|
||
|
dprintf_to_stdout=1;
|
||
|
|
||
|
dprintf(1,"\n"
|
||
|
"wconsd: Serial Console server (version %s)\n",VERSION);
|
||
Also available in: Unified diff
Clarify the meaning of one of the dprintf variables