summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorSuper User2007-08-11 10:12:10 +0200
committerSuper User2007-08-11 10:12:10 +0200
commit0a0643e3a561de5f34927ea80c2bd0ce6405fd3c (patch)
tree636f59202db625704b49a6148b2d0a2374714a44 /main.c
parentsome minor fixes (diff)
downloadlcr-0a0643e3a561de5f34927ea80c2bd0ce6405fd3c.tar.gz
lcr-0a0643e3a561de5f34927ea80c2bd0ce6405fd3c.tar.xz
lcr-0a0643e3a561de5f34927ea80c2bd0ce6405fd3c.zip
fixes, debugging for usleep problems.
Diffstat (limited to 'main.c')
-rw-r--r--main.c15
1 files changed, 14 insertions, 1 deletions
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;
}
}