comparison dbutil.c @ 1250:2bb4c662d1c2

more hard tab
author Francois Perrad <francois.perrad@gadz.org>
date Fri, 01 Jan 2016 15:02:09 +0100
parents 6ecc133fb2ee
children 94d4038bb34c
comparison
equal deleted inserted replaced
1249:c6346c63281b 1250:2bb4c662d1c2
155 155
156 void debug_start_net() 156 void debug_start_net()
157 { 157 {
158 if (getenv("DROPBEAR_DEBUG_NET_TIMESTAMP")) 158 if (getenv("DROPBEAR_DEBUG_NET_TIMESTAMP"))
159 { 159 {
160 /* Timestamps start from first network activity */ 160 /* Timestamps start from first network activity */
161 struct timeval tv; 161 struct timeval tv;
162 gettimeofday(&tv, NULL); 162 gettimeofday(&tv, NULL);
163 debug_start_time = tv.tv_sec + (tv.tv_usec / 1000000.0); 163 debug_start_time = tv.tv_sec + (tv.tv_usec / 1000000.0);
164 TRACE(("Resetting Dropbear TRACE timestamps")) 164 TRACE(("Resetting Dropbear TRACE timestamps"))
165 } 165 }
166 } 166 }
167 167
168 static double time_since_start() 168 static double time_since_start()
169 { 169 {
170 double nowf; 170 double nowf;
171 struct timeval tv; 171 struct timeval tv;
172 gettimeofday(&tv, NULL); 172 gettimeofday(&tv, NULL);
173 nowf = tv.tv_sec + (tv.tv_usec / 1000000.0); 173 nowf = tv.tv_sec + (tv.tv_usec / 1000000.0);
174 if (debug_start_time < 0) 174 if (debug_start_time < 0)
175 { 175 {
176 debug_start_time = nowf; 176 debug_start_time = nowf;
177 return 0; 177 return 0;
178 } 178 }
179 return nowf - debug_start_time; 179 return nowf - debug_start_time;
180 } 180 }
181 181
182 void dropbear_trace(const char* format, ...) { 182 void dropbear_trace(const char* format, ...) {
183 va_list param; 183 va_list param;
184 184