diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-01-18 17:27:41 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-01-18 17:27:41 +0100 |
commit | 6ffe233f9442792a0e8e52167a01b76eabd83be9 (patch) | |
tree | 37a461845d9395c2290bbde73c3c7f95a7d3a37f /source3/lib/async_req.c | |
parent | bfbb0fb17f4eedb8f22d0694c5d4a3b82dfe189b (diff) | |
parent | 0dbd3968626445b4dcb00307e45206b37dd0e8ad (diff) | |
download | samba-6ffe233f9442792a0e8e52167a01b76eabd83be9.tar.gz samba-6ffe233f9442792a0e8e52167a01b76eabd83be9.tar.bz2 samba-6ffe233f9442792a0e8e52167a01b76eabd83be9.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/lib/async_req.c')
-rw-r--r-- | source3/lib/async_req.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source3/lib/async_req.c b/source3/lib/async_req.c index 13b64ba79a..011948a158 100644 --- a/source3/lib/async_req.c +++ b/source3/lib/async_req.c @@ -313,3 +313,28 @@ bool async_req_enqueue(struct async_req_queue *queue, struct event_context *ev, return true; } + +bool _async_req_setup(TALLOC_CTX *mem_ctx, struct async_req **preq, + void *pstate, size_t state_size, const char *typename) +{ + struct async_req *req; + void **ppstate = (void **)pstate; + void *state; + + req = async_req_new(mem_ctx); + if (req == NULL) { + return false; + } + state = talloc_size(req, state_size); + if (state == NULL) { + TALLOC_FREE(req); + return false; + } + talloc_set_name(state, typename); + req->private_data = state; + + *preq = req; + *ppstate = state; + + return true; +} |