mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
Unregister event fix from metze.
Jeremy.
This commit is contained in:
parent
9c1bab9445
commit
0aee73d457
@ -210,18 +210,21 @@ void smb_run_idle_events(time_t now)
|
||||
struct smb_idle_list_ent *event = smb_idle_event_list;
|
||||
|
||||
while (event) {
|
||||
struct smb_idle_list_ent *next = event->next;
|
||||
time_t interval;
|
||||
|
||||
if (event->interval >= SMB_IDLE_EVENT_MIN_INTERVAL) {
|
||||
if (event->interval <= 0) {
|
||||
interval = SMB_IDLE_EVENT_DEFAULT_INTERVAL;
|
||||
} else if (event->interval >= SMB_IDLE_EVENT_MIN_INTERVAL) {
|
||||
interval = event->interval;
|
||||
} else {
|
||||
interval = SMB_IDLE_EVENT_MIN_INTERVAL;
|
||||
}
|
||||
if (now >(event->lastrun+interval)) {
|
||||
event->fn(&event->data,&event->interval,now);
|
||||
event->lastrun = now;
|
||||
event->fn(&event->data,&event->interval,now);
|
||||
}
|
||||
event = event->next;
|
||||
event = next;
|
||||
}
|
||||
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user