From: Guus Sliepen Date: Fri, 7 Dec 2012 14:49:21 +0000 (+0100) Subject: Fix infinite loop in timeout handling on Windows. X-Git-Tag: release-1.1pre5~21 X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=c26581e29f1f8f23217da266b57082e81dfc8320 Fix infinite loop in timeout handling on Windows. --- diff --git a/src/dropin.h b/src/dropin.h index 61143eb8..5279de79 100644 --- a/src/dropin.h +++ b/src/dropin.h @@ -58,7 +58,7 @@ extern int usleep(long long usec); #define timersub(a, b, r) do {\ (r)->tv_sec = (a)->tv_sec - (b)->tv_sec;\ (r)->tv_usec = (a)->tv_usec - (b)->tv_usec;\ - if((r)->tv_usec < 1000000)\ + if((r)->tv_usec < 0)\ (r)->tv_sec--, (r)->tv_usec += 1000000;\ } while (0) #endif