git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
185cc44
)
tevent: splitout tevent_queue_add_internal() from tevent_queue_add()
author
Stefan Metzmacher
<metze@samba.org>
Tue, 9 Aug 2011 13:33:37 +0000
(15:33 +0200)
committer
Stefan Metzmacher
<metze@samba.org>
Tue, 9 Aug 2011 14:17:10 +0000
(16:17 +0200)
metze
lib/tevent/tevent_queue.c
patch
|
blob
|
history
diff --git
a/lib/tevent/tevent_queue.c
b/lib/tevent/tevent_queue.c
index 3fca7fb9487c4e4f31fd46c92ba1984094c93418..7737b3e814799dea0cc6e6da005978d3b4d19d17 100644
(file)
--- a/
lib/tevent/tevent_queue.c
+++ b/
lib/tevent/tevent_queue.c
@@
-144,17
+144,18
@@
static void tevent_queue_immediate_trigger(struct tevent_context *ev,
q->list->trigger(q->list->req, q->list->private_data);
}
q->list->trigger(q->list->req, q->list->private_data);
}
-bool tevent_queue_add(struct tevent_queue *queue,
- struct tevent_context *ev,
- struct tevent_req *req,
- tevent_queue_trigger_fn_t trigger,
- void *private_data)
+static struct tevent_queue_entry *tevent_queue_add_internal(
+ struct tevent_queue *queue,
+ struct tevent_context *ev,
+ struct tevent_req *req,
+ tevent_queue_trigger_fn_t trigger,
+ void *private_data)
{
struct tevent_queue_entry *e;
e = talloc_zero(req, struct tevent_queue_entry);
if (e == NULL) {
{
struct tevent_queue_entry *e;
e = talloc_zero(req, struct tevent_queue_entry);
if (e == NULL) {
- return
false
;
+ return
NULL
;
}
e->queue = queue;
}
e->queue = queue;
@@
-175,11
+176,11
@@
bool tevent_queue_add(struct tevent_queue *queue,
talloc_set_destructor(e, tevent_queue_entry_destructor);
if (!queue->running) {
talloc_set_destructor(e, tevent_queue_entry_destructor);
if (!queue->running) {
- return
tru
e;
+ return e;
}
if (queue->list->triggered) {
}
if (queue->list->triggered) {
- return
tru
e;
+ return e;
}
tevent_schedule_immediate(queue->immediate,
}
tevent_schedule_immediate(queue->immediate,
@@
-187,6
+188,23
@@
bool tevent_queue_add(struct tevent_queue *queue,
tevent_queue_immediate_trigger,
queue);
tevent_queue_immediate_trigger,
queue);
+ return e;
+}
+
+bool tevent_queue_add(struct tevent_queue *queue,
+ struct tevent_context *ev,
+ struct tevent_req *req,
+ tevent_queue_trigger_fn_t trigger,
+ void *private_data)
+{
+ struct tevent_queue_entry *e;
+
+ e = tevent_queue_add_internal(queue, ev, req,
+ trigger, private_data);
+ if (e == NULL) {
+ return false;
+ }
+
return true;
}
return true;
}