- /* setup a timer */
- te.next_event = end_time;
- te.handler = pvfs_wait_timeout;
- te.private = pwait;
- pwait->te = event_add_timed(pwait->ev, &te, pwait);
+ if (!timeval_is_zero(&end_time)) {
+ /* setup a timer */
+ event_add_timed(pwait->ev, pwait, end_time, pvfs_wait_timeout, pwait);
+ }