re-apply fix for timer calculation

This commit is contained in:
Olaf Bergmann committed 2012-06-07 15:12:44 +02:00
1 parent 695f04a5f9
commit e35a1216f8
1 file changed
+1 -1
+1 -1
View File
@@ -416,7 +416,7 @@ main(int argc, char **argv) {
if ( nextpdu && nextpdu->t <= now + COAP_RESOURCE_CHECK_TIME ) {
/* set timeout if there is a pdu to send before our automatic timeout occurs */
tv.tv_usec = ((nextpdu->t - now) % COAP_TICKS_PER_SECOND) << 10;
tv.tv_usec = ((nextpdu->t - now) % COAP_TICKS_PER_SECOND) * 1000000 / COAP_TICKS_PER_SECOND;
tv.tv_sec = (nextpdu->t - now) / COAP_TICKS_PER_SECOND;
timeout = &tv;
} else {