diff options
author | Jeremy Allison <jra@samba.org> | 2003-09-17 23:36:55 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-09-17 23:36:55 +0000 |
commit | 6fc85b32339a6bc543fbf5c5be97bd2b7a570b6a (patch) | |
tree | 0d9a075162109de6c566472c1a0a5638c81afce3 /source3 | |
parent | 273479391f0c6e008c1e01a7f3ffa2de1862b9fd (diff) | |
download | samba-6fc85b32339a6bc543fbf5c5be97bd2b7a570b6a.tar.gz samba-6fc85b32339a6bc543fbf5c5be97bd2b7a570b6a.tar.bz2 samba-6fc85b32339a6bc543fbf5c5be97bd2b7a570b6a.zip |
Unregister event fix from metze.
Jeremy.
(This used to be commit 0aee73d45733a8eca437954e0c9fd54884bbe770)
Diffstat (limited to 'source3')
-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; |