Ignore:
Timestamp:
Jan 15, 2010, 8:23:30 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3 to 3.3.10 (source)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/smbd/blocking.c

    r206 r370  
    9595
    9696/****************************************************************************
     97 We need a version of timeval_min that treats zero timval as infinite.
     98****************************************************************************/
     99
     100static struct timeval timeval_brl_min(const struct timeval *tv1,
     101                                        const struct timeval *tv2)
     102{
     103        if (timeval_is_zero(tv1)) {
     104                return *tv2;
     105        }
     106        if (timeval_is_zero(tv2)) {
     107                return *tv1;
     108        }
     109        return timeval_min(tv1, tv2);
     110}
     111
     112/****************************************************************************
    97113 After a change to blocking_lock_queue, recalculate the timed_event for the
    98114 next processing.
     
    117133                        if (brl->blocking_pid == 0xFFFFFFFF) {
    118134                                struct timeval psx_to = timeval_current_ofs(10, 0);
    119                                 next_timeout = timeval_min(&next_timeout, &psx_to);
     135                                next_timeout = timeval_brl_min(&next_timeout, &psx_to);
    120136                        }
    121137
     
    123139                }
    124140
    125                 if (timeval_is_zero(&next_timeout)) {
    126                         next_timeout = brl->expire_time;
    127                 }
    128                 else {
    129                         next_timeout = timeval_min(&next_timeout,
    130                                                    &brl->expire_time);
    131                 }
     141                next_timeout = timeval_brl_min(&next_timeout, &brl->expire_time);
    132142        }
    133143
     
    687697        struct timeval tv_curr = timeval_current();
    688698        blocking_lock_record *blr, *next = NULL;
    689         bool recalc_timeout = False;
    690699
    691700        /*
     
    737746                        DLIST_REMOVE(blocking_lock_queue, blr);
    738747                        free_blocking_lock_record(blr);
    739                         recalc_timeout = True;
    740748                        continue;
    741749                }
     
    762770                        DLIST_REMOVE(blocking_lock_queue, blr);
    763771                        free_blocking_lock_record(blr);
    764                         recalc_timeout = True;
    765772                        change_to_root_user();
    766773                        continue;
     
    788795                        DLIST_REMOVE(blocking_lock_queue, blr);
    789796                        free_blocking_lock_record(blr);
    790                         recalc_timeout = True;
    791797                        change_to_root_user();
    792798                        continue;
     
    824830                        DLIST_REMOVE(blocking_lock_queue, blr);
    825831                        free_blocking_lock_record(blr);
    826                         recalc_timeout = True;
    827                 }
    828         }
    829 
    830         if (recalc_timeout) {
    831                 recalc_brl_timeout();
    832         }
     832                }
     833        }
     834
     835        recalc_brl_timeout();
    833836}
    834837
Note: See TracChangeset for help on using the changeset viewer.