diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-01-19 13:39:54 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-01-19 13:39:54 +1100 |
commit | d6e801b7d9a666d40f109df20dff0faaa2b46e70 (patch) | |
tree | 77d5e6ac67825eca5b8c970f6bfba95d8002f024 /source3/lib/async_req.c | |
parent | 9fa6fb3d9fb2e4cee81ad34d6fd0cbe6f5265171 (diff) | |
parent | fe9dd8710d577478b324d1d507de0ecd77df2ea5 (diff) | |
download | samba-d6e801b7d9a666d40f109df20dff0faaa2b46e70.tar.gz samba-d6e801b7d9a666d40f109df20dff0faaa2b46e70.tar.bz2 samba-d6e801b7d9a666d40f109df20dff0faaa2b46e70.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba into abartlet-devel
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; +} |