diff options
author | Jeremy Allison <jra@samba.org> | 2006-12-08 18:40:13 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:23 -0500 |
commit | 5ce139751bb77879f127dfa876cf1999717b69fc (patch) | |
tree | df7d0e13b04affc9df9ee1ed2696ba1823400115 /source3/lib | |
parent | 5be92d0d1866b483ee7e9599b691044f4059ea3f (diff) | |
download | samba-5ce139751bb77879f127dfa876cf1999717b69fc.tar.gz samba-5ce139751bb77879f127dfa876cf1999717b69fc.tar.bz2 samba-5ce139751bb77879f127dfa876cf1999717b69fc.zip |
r20087: Ensure we clean up any random pending events we
may have inherited from our parent in the winbindd
forked child.
Jeremy.
(This used to be commit 0a1352f440a9d9b974ad8d571b2e48a43a15b6cc)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/events.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/lib/events.c b/source3/lib/events.c index d6f3c32828..66aefa3b52 100644 --- a/source3/lib/events.c +++ b/source3/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; +} |