diff options
author | ajs <ajs> | 2004-12-28 17:00:12 +0000 |
---|---|---|
committer | ajs <ajs> | 2004-12-28 17:00:12 +0000 |
commit | af04bd7c102c3fc1a9c2e98337b0ab1fa824d080 (patch) | |
tree | f0a71ed52fa703ed6d1bccc84faa90aeb0943a62 /lib | |
parent | c6487d61a9b7766f69718edbc484a6ad989bdef4 (diff) |
2004-12-28 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* thread.c: (funcname_thread_add_timer_msec) Reduce overflow risk.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ChangeLog | 4 | ||||
-rw-r--r-- | lib/thread.c | 6 |
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); } |