From eb511324fcb7cc1b96375f2047d98c2395ee949b Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 22 Jul 2008 14:34:59 +0000 Subject: Fixing the timeout condition that could sometime fail for non-watchable handles. --- lib/TaskMan.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/TaskMan.cc b/lib/TaskMan.cc index f42e8bd..b147a36 100644 --- a/lib/TaskMan.cc +++ b/lib/TaskMan.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: TaskMan.cc,v 1.57 2008-07-02 16:35:51 pixel Exp $ */ +/* $Id: TaskMan.cc,v 1.58 2008-07-22 14:34:59 pixel Exp $ */ #ifndef _WIN32 #include @@ -689,7 +689,7 @@ void TaskMan::MainLoop() throw (GeneralException) { r = poll(ufsd, nfds, timeout_condition ? timeout : 0); #else struct timespec ttimeout = { 0, 0 }; - if (timeout != -1) { + if ((timeout != -1) && timeout_condition) { ttimeout.tv_sec = timeout / 1000; ttimeout.tv_nsec = (timeout - (ttimeout.tv_sec * 1000)) * 1000000; } -- cgit v1.2.3