comparison dbutil.c @ 94:c85c88500ea6

DEBUG_TRACE now only triggers with -v on the cmdline
author Matt Johnston <matt@ucc.asn.au>
date Wed, 18 Aug 2004 15:48:25 +0000
parents 0bf5cebe622c
children d3eb1fa8484e
comparison
equal deleted inserted replaced
93:5dda5a4d475c 94:c85c88500ea6
64 void (*_dropbear_exit)(int exitcode, const char* format, va_list param) 64 void (*_dropbear_exit)(int exitcode, const char* format, va_list param)
65 = generic_dropbear_exit; 65 = generic_dropbear_exit;
66 void (*_dropbear_log)(int priority, const char* format, va_list param) 66 void (*_dropbear_log)(int priority, const char* format, va_list param)
67 = generic_dropbear_log; 67 = generic_dropbear_log;
68 68
69 #ifdef DEBUG_TRACE
70 int debug_trace = 0;
71 #endif
72
69 int usingsyslog = 0; /* set by runopts, but required externally to sessions */ 73 int usingsyslog = 0; /* set by runopts, but required externally to sessions */
70 #ifndef DISABLE_SYSLOG 74 #ifndef DISABLE_SYSLOG
71 void startsyslog() { 75 void startsyslog() {
72 76
73 openlog(PROGNAME, LOG_PID, LOG_AUTHPRIV); 77 openlog(PROGNAME, LOG_PID, LOG_AUTHPRIV);
131 135
132 #ifdef DEBUG_TRACE 136 #ifdef DEBUG_TRACE
133 void dropbear_trace(const char* format, ...) { 137 void dropbear_trace(const char* format, ...) {
134 138
135 va_list param; 139 va_list param;
140
141 if (!debug_trace) {
142 return;
143 }
136 144
137 va_start(param, format); 145 va_start(param, format);
138 fprintf(stderr, "TRACE: "); 146 fprintf(stderr, "TRACE: ");
139 vfprintf(stderr, format, param); 147 vfprintf(stderr, format, param);
140 fprintf(stderr, "\n"); 148 fprintf(stderr, "\n");