From 97681fd7eb07a963965325cb89f5432ee74e2bee Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Tue, 19 Jun 2007 03:00:46 +0000 Subject: [PATCH] Fix to compile in Borland C99: CLOCKS_PER_SEC, and clock_t, can be a float. [SVN r38034] --- src/engine/execnt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/engine/execnt.c b/src/engine/execnt.c index 11e9833d8..9a334df98 100644 --- a/src/engine/execnt.c +++ b/src/engine/execnt.c @@ -924,8 +924,10 @@ static int try_kill_one() static void close_alerts() { /* we only attempt this every 5 seconds, or so, because it's - not a cheap operation, and we'll catch the alerts eventually. */ - if ( (clock() % (CLOCKS_PER_SEC*5)) < (CLOCKS_PER_SEC/2) ) + not a cheap operation, and we'll catch the alerts eventually. + this check uses floats as some compilers define CLOCKS_PER_SEC + as a float or double. */ + if ( ((float)clock() / (float)(CLOCKS_PER_SEC*5)) < (1.0/5.0) ) { int i; for ( i = 0; i < globs.jobs; ++i )