summaryrefslogtreecommitdiff
path: root/source3/lib/events.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/events.c')
-rw-r--r--source3/lib/events.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source3/lib/events.c b/source3/lib/events.c
index 7da44c3466..d6f3c32828 100644
--- a/source3/lib/events.c
+++ b/source3/lib/events.c
@@ -58,7 +58,8 @@ struct timed_event *add_timed_event(TALLOC_CTX *mem_ctx,
te->handler = handler;
te->private_data = private_data;
- /* keep the list ordered */
+ /* keep the list ordered - this is NOT guarenteed as event times
+ may be changed after insertion */
last_te = NULL;
for (cur_te = timed_events; cur_te; cur_te = cur_te->next) {
/* if the new event comes before the current one break */
@@ -115,3 +116,17 @@ struct timeval *get_timed_events_timeout(struct timeval *to_ret)
return to_ret;
}
+
+int set_event_dispatch_time(const char *event_name, struct timeval when)
+{
+ int num_events = 0;
+ struct timed_event *te;
+
+ for (te = timed_events; te; te = te->next) {
+ if (strcmp(event_name, te->event_name) == 0) {
+ te->when = when;
+ num_events++;
+ }
+ }
+ return num_events;
+}