summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ChangeLog4
-rw-r--r--lib/thread.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 07eb21d1..cc5f8673 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,7 @@
+2004-12-28 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+ * thread.c: (funcname_thread_add_timer_msec) Reduce overflow risk.
+
2004-12-21 Paul Jakma <paul.jakma@sun.com>
* if.h: Add more 'non-generic' IFF_ flags.
diff --git a/lib/thread.c b/lib/thread.c
index 89df06a0..05212d85 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -550,10 +550,8 @@ funcname_thread_add_timer_msec (struct thread_master *m,
assert (m != NULL);
- timer = 1000*timer; /* milli -> micro */
-
- trel.tv_sec = timer / TIMER_SECOND_MICRO;
- trel.tv_usec = (timer % TIMER_SECOND_MICRO);
+ trel.tv_sec = timer / 1000;
+ trel.tv_usec = 1000*(timer % 1000);
return funcname_thread_add_timer_timeval (m, func, arg, &trel, funcname);
}