r14614: handle zero timers in pvfs_wait()
authorAndrew Tridgell <tridge@samba.org>
Tue, 21 Mar 2006 11:39:48 +0000 (11:39 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:59:02 +0000 (13:59 -0500)
(This used to be commit cc1f8b3ebe2dcab6f21913af9baf231f3250120e)

source4/ntvfs/posix/pvfs_wait.c

index 6cb24e1f92e684bc9a907b7819ac0ad22280f839..2d7e41c247481a1e6efa786698f385212212ffe3 100644 (file)
@@ -33,7 +33,6 @@ struct pvfs_wait {
        struct pvfs_state *pvfs;
        void (*handler)(void *, enum pvfs_wait_notice);
        void *private;
-       struct timed_event *te;
        int msg_type;
        struct messaging_context *msg_ctx;
        struct event_context *ev;
@@ -140,9 +139,10 @@ void *pvfs_wait_message(struct pvfs_state *pvfs,
        pwait->req = talloc_reference(pwait, req);
        pwait->pvfs = pvfs;
 
-       /* setup a timer */
-       pwait->te = event_add_timed(pwait->ev, pwait, end_time, 
-                                   pvfs_wait_timeout, pwait);
+       if (!timeval_is_zero(&end_time)) {
+               /* setup a timer */
+               event_add_timed(pwait->ev, pwait, end_time, pvfs_wait_timeout, pwait);
+       }
 
        /* register with the messaging subsystem for this message
           type */