summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-12-08 18:40:13 +0000
committerJeremy Allison <jra@samba.org>2006-12-08 18:40:13 +0000
commit2974fb49def3f8ad1da0108b996bbb5a3a938f5e (patch)
tree4a29268d965bb08d2fbccc77cb0d7bc60bd0bc80 /source/lib
parentdb3d9201388afe0024a6831bfee2ccefea569ebb (diff)
downloadsamba-2974fb49def3f8ad1da0108b996bbb5a3a938f5e.tar.gz
samba-2974fb49def3f8ad1da0108b996bbb5a3a938f5e.tar.xz
samba-2974fb49def3f8ad1da0108b996bbb5a3a938f5e.zip
r20087: Ensure we clean up any random pending events we
may have inherited from our parent in the winbindd forked child. Jeremy.
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/events.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/lib/events.c b/source/lib/events.c
index d6f3c328288..66aefa3b52d 100644
--- a/source/lib/events.c
+++ b/source/lib/events.c
@@ -130,3 +130,18 @@ int set_event_dispatch_time(const char *event_name, struct timeval when)
}
return num_events;
}
+
+/* Returns 1 if event was found and cancelled, 0 otherwise. */
+
+int cancel_named_event(const char *event_name)
+{
+ struct timed_event *te;
+
+ for (te = timed_events; te; te = te->next) {
+ if (strcmp(event_name, te->event_name) == 0) {
+ TALLOC_FREE(te);
+ return 1;
+ }
+ }
+ return 0;
+}