From 0a0643e3a561de5f34927ea80c2bd0ce6405fd3c Mon Sep 17 00:00:00 2001 From: Super User Date: Sat, 11 Aug 2007 10:12:10 +0200 Subject: fixes, debugging for usleep problems. --- main.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 2f11938..69d6ab7 100644 --- a/main.c +++ b/main.c @@ -66,6 +66,11 @@ int last_debug = 0; int debug_newline = 1; int nooutput = 0; +void debug_usleep(int msec, char *file, int line, int hour, int min, int sec) +{ + usleep(msec); +} + void debug(const char *function, int line, char *prefix, char *buffer) { /* if we have a new debug count, we add a mark */ @@ -463,10 +468,16 @@ int main(int argc, char *argv[]) /* all loops must be counted from the beginning since nodes might get freed during handler */ all_idle = 1; +#warning debugging usleep crash + debug_usleep(1, __FILE__, __LINE__, now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec); + /* handle mISDN messages from kernel */ debug_prefix = "ISDN"; if (mISDN_handler()) all_idle = 0; +#warning debugging usleep crash + debug_usleep(1, __FILE__, __LINE__, now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec); + #ifdef DEBUG_DURATION GET_NOW(); isdn_duration += (now_d - start_d); @@ -638,6 +649,8 @@ BUDETECT all_idle = 0; } #endif +#warning debugging usleep crash + debug_usleep(1, __FILE__, __LINE__, now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec); /* do idle checking */ if (idlecheck != now) @@ -670,7 +683,7 @@ BUDETECT /* did we do nothing? so we wait to give time to other processes */ if (all_idle) { - usleep(4000); /* wait 32 samples */ + debug_usleep(4000, __FILE__, __LINE__, now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec); idletime += 4000; } } -- cgit v1.2.3-55-g7522