From: John Hodge Date: Thu, 3 Mar 2011 13:31:57 +0000 (+0800) Subject: Fixed sleep (darn order of subtraction) :) X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=2396d4b3485f0a7cc120f8b614d963aec2cca068;p=tpg%2Fopendispense2.git Fixed sleep (darn order of subtraction) :) --- diff --git a/src/server/handler_coke.c b/src/server/handler_coke.c index 8c82a07..58e3b79 100644 --- a/src/server/handler_coke.c +++ b/src/server/handler_coke.c @@ -204,7 +204,9 @@ int Coke_DoDispense(int UNUSED(User), int Item) // Make sure there are not two dispenses within n seconds if( time(NULL) - gtCoke_LastDispenseTime < 10 ) { - sleep( 10 - time(NULL) - gtCoke_LastDispenseTime ); + printf("Wait %li seconds?\n", 10 - (time(NULL) - gtCoke_LastDispenseTime)); + sleep( 10 - (time(NULL) - gtCoke_LastDispenseTime) ); + printf("wait done\n"); } // LOCK