diff options
author | Jeremy Allison <jra@samba.org> | 2003-09-17 23:36:58 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-09-17 23:36:58 +0000 |
commit | 92347f2d0f3972db9e4e686db989d292689175be (patch) | |
tree | 9efefdcccb8375fcf5c0dbc8616aa3eb9a22dc8f /source3/lib | |
parent | 53185ba285991b24d88f5b3c6c4e9e0eed1c1431 (diff) | |
download | samba-92347f2d0f3972db9e4e686db989d292689175be.tar.gz samba-92347f2d0f3972db9e4e686db989d292689175be.tar.bz2 samba-92347f2d0f3972db9e4e686db989d292689175be.zip |
Unregister event fix from metze.
Jeremy.
(This used to be commit b3b2b3d5e7c9d4995890bf7b156fc1176b042cfc)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/module.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/lib/module.c b/source3/lib/module.c index 941a6cfbe3..38fcf0f329 100644 --- a/source3/lib/module.c +++ b/source3/lib/module.c @@ -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; |