summaryrefslogtreecommitdiff
path: root/src/common/compat.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-12-26 17:58:51 -0500
committerNick Mathewson <nickm@torproject.org>2011-12-26 17:58:51 -0500
commit85d78114563d00015ffec35a7d3c854c18707fec (patch)
treecbadec284efc6301d275bdad3849fea9f2d66a10 /src/common/compat.h
parent3aade2fab7030211b7a8ae6ab1bd310c378be462 (diff)
parentda876aec63b133b64eb6e71f8b87df5c84e7ec3b (diff)
downloadtor-85d78114563d00015ffec35a7d3c854c18707fec.tar.gz
tor-85d78114563d00015ffec35a7d3c854c18707fec.zip
Merge remote-tracking branch 'origin/maint-0.2.2'
Diffstat (limited to 'src/common/compat.h')
-rw-r--r--src/common/compat.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/compat.h b/src/common/compat.h
index 1394717882..2db8107a8e 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -335,7 +335,7 @@ struct tm *tor_gmtime_r(const time_t *timep, struct tm *result);
#define timeradd(tv1,tv2,tvout) \
do { \
(tvout)->tv_sec = (tv1)->tv_sec + (tv2)->tv_sec; \
- (tvout)->tv_usec = (tv2)->tv_usec + (tv2)->tv_usec; \
+ (tvout)->tv_usec = (tv1)->tv_usec + (tv2)->tv_usec; \
if ((tvout)->tv_usec >= 1000000) { \
(tvout)->tv_usec -= 1000000; \
(tvout)->tv_sec++; \
@@ -349,7 +349,7 @@ struct tm *tor_gmtime_r(const time_t *timep, struct tm *result);
#define timersub(tv1,tv2,tvout) \
do { \
(tvout)->tv_sec = (tv1)->tv_sec - (tv2)->tv_sec; \
- (tvout)->tv_usec = (tv2)->tv_usec - (tv2)->tv_usec; \
+ (tvout)->tv_usec = (tv1)->tv_usec - (tv2)->tv_usec; \
if ((tvout)->tv_usec < 0) { \
(tvout)->tv_usec += 1000000; \
(tvout)->tv_sec--; \