From a67cd9683ec4a7091a512be705eef105f989410d Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Sun, 27 Jan 2008 17:38:20 +0000 Subject: fixed queue termination in case bSaveOnShutdown is 0 --- srUtils.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'srUtils.c') diff --git a/srUtils.c b/srUtils.c index 7e585ad7..9724190a 100755 --- a/srUtils.c +++ b/srUtils.c @@ -344,8 +344,17 @@ timeoutVal(struct timespec *pt) assert(pt != NULL); /* compute timeout */ clock_gettime(CLOCK_REALTIME, &t); - iTimeout = (pt->tv_nsec - t.tv_nsec) / 1000; +RUNLOG_VAR("%ld", pt->tv_sec); +RUNLOG_VAR("%ld", t.tv_sec); +RUNLOG_VAR("%ld", pt->tv_nsec); +RUNLOG_VAR("%ld", t.tv_nsec); + iTimeout = (pt->tv_nsec - t.tv_nsec) / 1000000; +RUNLOG_VAR("%ld", iTimeout); iTimeout += (pt->tv_sec - t.tv_sec) * 1000; +RUNLOG_VAR("%ld", iTimeout); + + if(iTimeout < 0) + iTimeout = 0; return iTimeout; } -- cgit v1.2.3