summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-01-21 23:19:59 +0000
committerStefan Metzmacher <metze@samba.org>2004-01-21 23:19:59 +0000
commitaafd0efc582ae4b857d19cc50a73bad1a67f0f28 (patch)
treed0e9b9b0bef2228ba219c5799498d6ffe9f464b4 /source4/lib
parent0593fd96fb4e12dd1014dd936e088521fb2b0231 (diff)
downloadsamba-aafd0efc582ae4b857d19cc50a73bad1a67f0f28.tar.gz
samba-aafd0efc582ae4b857d19cc50a73bad1a67f0f28.tar.bz2
samba-aafd0efc582ae4b857d19cc50a73bad1a67f0f28.zip
let the event_add_XXX() function return a pointer of the allocated event structure
and NULL on allacation error. metze (This used to be commit fffc6cfb6b9946155d209dd14faa79c5b9d43d1d)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/events.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source4/lib/events.c b/source4/lib/events.c
index 00d32043f7..4c30f2cacb 100644
--- a/source4/lib/events.c
+++ b/source4/lib/events.c
@@ -88,18 +88,18 @@ struct event_context *event_context_init(void)
/*
add a fd based event
- return False on failure (memory allocation error)
+ return NULL on failure (memory allocation error)
*/
-BOOL event_add_fd(struct event_context *ev, struct fd_event *e)
+struct fd_event *event_add_fd(struct event_context *ev, struct fd_event *e)
{
e = memdup(e, sizeof(*e));
- if (!e) return False;
+ if (!e) return NULL;
DLIST_ADD(ev->fd_events, e);
e->ref_count = 1;
if (e->fd > ev->maxfd) {
ev->maxfd = e->fd;
}
- return True;
+ return e;
}
@@ -172,15 +172,15 @@ void event_remove_fd_all_handler(struct event_context *ev, void *handler)
/*
add a timed event
- return False on failure (memory allocation error)
+ return NULL on failure (memory allocation error)
*/
-BOOL event_add_timed(struct event_context *ev, struct timed_event *e)
+struct timed_event *event_add_timed(struct event_context *ev, struct timed_event *e)
{
e = memdup(e, sizeof(*e));
- if (!e) return False;
+ if (!e) return NULL;
e->ref_count = 1;
DLIST_ADD(ev->timed_events, e);
- return True;
+ return e;
}
/*
@@ -203,15 +203,15 @@ BOOL event_remove_timed(struct event_context *ev, struct timed_event *e1)
/*
add a loop event
- return False on failure (memory allocation error)
+ return NULL on failure (memory allocation error)
*/
-BOOL event_add_loop(struct event_context *ev, struct loop_event *e)
+struct loop_event *event_add_loop(struct event_context *ev, struct loop_event *e)
{
e = memdup(e, sizeof(*e));
- if (!e) return False;
+ if (!e) return NULL;
e->ref_count = 1;
DLIST_ADD(ev->loop_events, e);
- return True;
+ return e;
}
/*