Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 228411 Details for
Bug 333691
autofs should use acturate time when using pthread_cond_timedwait
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to correct timeval usage
autofs-5.0.2-hi-res-time.patch (text/plain), 1.85 KB, created by
Ian Kent
on 2007-10-16 08:43:05 UTC
(
hide
)
Description:
Patch to correct timeval usage
Filename:
MIME Type:
Creator:
Ian Kent
Created:
2007-10-16 08:43:05 UTC
Size:
1.85 KB
patch
obsolete
>diff --git a/CHANGELOG b/CHANGELOG >index 903e619..bc4d8fd 100644 >--- a/CHANGELOG >+++ b/CHANGELOG >@@ -8,6 +8,7 @@ > with existing downstream version 4 naming. > - fix mount point directory creation for bind mounts. > - add quoting for exports gathered by hosts map. >+- fix wait time resolution in alarm and state queue handlers. > > 18/06/2007 autofs-5.0.2 > ----------------------- >diff --git a/daemon/state.c b/daemon/state.c >index 6c373c8..39f4497 100644 >--- a/daemon/state.c >+++ b/daemon/state.c >@@ -894,6 +894,7 @@ static void *st_queue_handler(void *arg) > struct list_head *head; > struct list_head *p; > struct timespec wait; >+ struct timeval now; > int status, ret; > > st_mutex_lock(); >@@ -904,8 +905,9 @@ static void *st_queue_handler(void *arg) > * entry is added. > */ > head = &state_queue; >- wait.tv_sec = time(NULL) + 1; >- wait.tv_nsec = 0; >+ gettimeofday(&now, NULL); >+ wait.tv_sec = now.tv_sec + 1; >+ wait.tv_nsec = now.tv_usec * 1000; > > while (list_empty(head)) { > status = pthread_cond_timedwait(&cond, &mutex, &wait); >@@ -939,8 +941,9 @@ static void *st_queue_handler(void *arg) > } > > while (1) { >- wait.tv_sec = time(NULL) + 1; >- wait.tv_nsec = 0; >+ gettimeofday(&now, NULL); >+ wait.tv_sec = now.tv_sec + 1; >+ wait.tv_nsec = now.tv_usec * 1000; > > signaled = 0; > while (!signaled) { >diff --git a/lib/alarm.c b/lib/alarm.c >index c6c4ba3..90bf7aa 100755 >--- a/lib/alarm.c >+++ b/lib/alarm.c >@@ -192,12 +192,14 @@ static void *alarm_handler(void *arg) > now = time(NULL); > > if (first->time > now) { >+ struct timeval usecs; > /* > * Wait for alarm to trigger or a new alarm > * to be added. > */ >+ gettimeofday(&usecs, NULL); > expire.tv_sec = first->time; >- expire.tv_nsec = 0; >+ expire.tv_nsec = usecs.tv_usec * 1000; > > status = pthread_cond_timedwait(&cond, &mutex, &expire); > if (status && status != ETIMEDOUT)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 333691
: 228411