1 diff --git a/CHANGELOG b/CHANGELOG
2 index 903e619..bc4d8fd 100644
6 with existing downstream version 4 naming.
7 - fix mount point directory creation for bind mounts.
8 - add quoting for exports gathered by hosts map.
9 +- fix wait time resolution in alarm and state queue handlers.
11 18/06/2007 autofs-5.0.2
12 -----------------------
13 diff --git a/daemon/state.c b/daemon/state.c
14 index 6c373c8..39f4497 100644
17 @@ -894,6 +894,7 @@ static void *st_queue_handler(void *arg)
18 struct list_head *head;
25 @@ -904,8 +905,9 @@ static void *st_queue_handler(void *arg)
29 - wait.tv_sec = time(NULL) + 1;
31 + gettimeofday(&now, NULL);
32 + wait.tv_sec = now.tv_sec + 1;
33 + wait.tv_nsec = now.tv_usec * 1000;
35 while (list_empty(head)) {
36 status = pthread_cond_timedwait(&cond, &mutex, &wait);
37 @@ -939,8 +941,9 @@ static void *st_queue_handler(void *arg)
41 - wait.tv_sec = time(NULL) + 1;
43 + gettimeofday(&now, NULL);
44 + wait.tv_sec = now.tv_sec + 1;
45 + wait.tv_nsec = now.tv_usec * 1000;
49 diff --git a/lib/alarm.c b/lib/alarm.c
50 index c6c4ba3..90bf7aa 100755
53 @@ -192,12 +192,14 @@ static void *alarm_handler(void *arg)
56 if (first->time > now) {
57 + struct timeval usecs;
59 * Wait for alarm to trigger or a new alarm
62 + gettimeofday(&usecs, NULL);
63 expire.tv_sec = first->time;
65 + expire.tv_nsec = usecs.tv_usec * 1000;
67 status = pthread_cond_timedwait(&cond, &mutex, &expire);
68 if (status && status != ETIMEDOUT)