Ensure timer never set to zero for millisleep. Bug 1426
authorJeremy Harris <jgh146exb@wizmail.org>
Mon, 26 May 2014 15:09:37 +0000 (16:09 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Tue, 22 Jul 2014 22:06:15 +0000 (23:06 +0100)
src/src/exim.c

index 517b5435ebc675fb6ac6ef5a746a5870faea749b..6a2336450fabc909f74624d2cf528b531eade000 100644 (file)
@@ -310,7 +310,8 @@ struct itimerval itval;
 itval.it_interval.tv_sec = 0;
 itval.it_interval.tv_usec = 0;
 itval.it_value.tv_sec = msec/1000;
-itval.it_value.tv_usec = (msec % 1000) * 1000;
+if ((itval.it_value.tv_usec = (msec % 1000) * 1000) == 0)
+  itval.it_value.tv_usec = 1;
 milliwait(&itval);
 }