Commit 2dc20709 authored by Wayne Davison's avatar Wayne Davison

Fix msleep() if time goes backwards. Fixes bug 9789.

parent 4442f803
......@@ -1320,6 +1320,8 @@ int msleep(int t)
select(0,NULL,NULL, NULL, &tval);
gettimeofday(&t2, NULL);
if (t2.tv_sec < t1.tv_sec)
t1 = t2; /* Time went backwards, so start over. */
tdiff = (t2.tv_sec - t1.tv_sec)*1000 +
(t2.tv_usec - t1.tv_usec)/1000;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment