fedora-cvs-commits@redhat.com
[Top] [All Lists]

rpms/autofs/FC-6 autofs-5.0.1-hi-res-time.patch, NONE, 1.1 autofs.spec,

Subject: rpms/autofs/FC-6 autofs-5.0.1-hi-res-time.patch, NONE, 1.1 autofs.spec, 1.181, 1.182
From:
Date: Wed, 18 Jul 2007 10:13:47 -0400
Author: ikent

Update of /cvs/dist/rpms/autofs/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv6772

Modified Files:
        autofs.spec 
Added Files:
        autofs-5.0.1-hi-res-time.patch 
Log Message:
* Wed Jul 18 2007 Ian Kent <ikent@xxxxxxxxxx> - 5.0.1-32
- fix wait time resolution in alarm and state queue handlers (bz 247711).


autofs-5.0.1-hi-res-time.patch:
 daemon/state.c |   11 +++++++----
 lib/alarm.c    |    4 +++-
 2 files changed, 10 insertions(+), 5 deletions(-)

--- NEW FILE autofs-5.0.1-hi-res-time.patch ---
--- autofs-5.0.1/daemon/state.c.hi-res-time     2007-07-17 22:29:23.000000000 
+0800
+++ autofs-5.0.1/daemon/state.c 2007-07-17 22:29:59.000000000 +0800
@@ -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) {
--- autofs-5.0.1/lib/alarm.c.hi-res-time        2007-07-17 22:29:23.000000000 
+0800
+++ autofs-5.0.1/lib/alarm.c    2007-07-17 22:32:06.000000000 +0800
@@ -178,6 +178,7 @@ static void *alarm_handler(void *arg)
 
        while (1) {
                struct alarm *current;
+               struct timeval usecs;
 
                /*
                 * If the alarm list is empty, wait until an alarm is
@@ -215,8 +216,9 @@ static void *alarm_handler(void *arg)
                        continue;
                }
 
+               gettimeofday(&usecs, NULL);
                expire.tv_sec = current->time;
-               expire.tv_nsec = 0;
+               expire.tv_nsec = usecs.tv_usec * 1000;
 
                while (1) {
                        struct autofs_point *ap;


Index: autofs.spec
===================================================================
RCS file: /cvs/dist/rpms/autofs/FC-6/autofs.spec,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -r1.181 -r1.182
--- autofs.spec 7 Jun 2007 06:47:13 -0000       1.181
+++ autofs.spec 18 Jul 2007 14:13:45 -0000      1.182
@@ -4,7 +4,7 @@
 Summary: A tool for automatically mounting and unmounting filesystems
 Name: autofs
 %define version 5.0.1
-%define release 0.rc3.31
+%define release 0.rc3.32
 Version: %{version}
 Release: %{release}
 Epoch: 1
@@ -36,6 +36,7 @@
 Patch23: autofs-5.0.1-cmd-global-options-fix.patch
 Patch24: autofs-5.0.1-rc3-map-update-source-only.patch
 Patch25: autofs-5.0.1-rc3-alarm-deadlock.patch
+Patch26: autofs-5.0.1-hi-res-time.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, 
libxml2-devel, cyrus-sasl-devel, openssl-devel
 Conflicts: kernel < 2.6.17
@@ -103,6 +104,7 @@
 %patch23 -p1
 %patch24 -p1
 %patch25 -p1
+%patch26 -p1
 
 %build
 #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@@ -159,6 +161,9 @@
 %{_libdir}/autofs/*
 
 %changelog
+* Wed Jul 18 2007 Ian Kent <ikent@xxxxxxxxxx> - 5.0.1-32
+- fix wait time resolution in alarm and state queue handlers (bz 247711).
+
 * Thu Jun 7 2007 Ian Kent <ikent@xxxxxxxxxx> - 5.0.1-0.rc3.31
 - fix deadlock in alarm manager module.
 

-- 
fedora-cvs-commits mailing list
fedora-cvs-commits@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-cvs-commits

<Prev in Thread] Current Thread [Next in Thread>
  • rpms/autofs/FC-6 autofs-5.0.1-hi-res-time.patch, NONE, 1.1 autofs.spec, 1.181, 1.182, fedora-cvs-commits <=