diff options
author | Michael Adam <obnox@samba.org> | 2014-09-30 11:29:22 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2014-09-30 16:36:10 +0200 |
commit | 00d9ee04dd0f5c2fe5e0cd7108ed7da4b981c258 (patch) | |
tree | 4d6a38054725b63b30084314c516ef33f2bde2c3 | |
parent | d8af3e76a362328a854aeb83f8699443e77d2a8d (diff) | |
download | samba-00d9ee04dd0f5c2fe5e0cd7108ed7da4b981c258.tar.gz |
s3:messaging: allow the messaging receive callback to change the fds
This allows the callback to consume the fds and e.g. set
them to -1 so that the caller can then treat (close) only those
fds that have not been consumed.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r-- | source3/lib/messages.c | 2 | ||||
-rw-r--r-- | source3/lib/messages_dgm.c | 4 | ||||
-rw-r--r-- | source3/lib/messages_dgm.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c index e2d0880e043..86198771ff8 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -204,7 +204,7 @@ bool message_send_all(struct messaging_context *msg_ctx, } static void messaging_recv_cb(const uint8_t *msg, size_t msg_len, - const int *fds, size_t num_fds, + int *fds, size_t num_fds, void *private_data) { struct messaging_context *msg_ctx = talloc_get_type_abort( diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c index 30ab7439aad..ae35282b4af 100644 --- a/source3/lib/messages_dgm.c +++ b/source3/lib/messages_dgm.c @@ -44,7 +44,7 @@ struct messaging_dgm_context { void (*recv_cb)(const uint8_t *msg, size_t msg_len, - const int *fds, + int *fds, size_t num_fds, void *private_data); void *recv_cb_private_data; @@ -181,7 +181,7 @@ int messaging_dgm_init(struct tevent_context *ev, uid_t dir_owner, void (*recv_cb)(const uint8_t *msg, size_t msg_len, - const int *fds, + int *fds, size_t num_fds, void *private_data), void *recv_cb_private_data) diff --git a/source3/lib/messages_dgm.h b/source3/lib/messages_dgm.h index be4b1e5eec0..00ff56f30c3 100644 --- a/source3/lib/messages_dgm.h +++ b/source3/lib/messages_dgm.h @@ -26,7 +26,7 @@ int messaging_dgm_init(struct tevent_context *ev, uid_t dir_owner, void (*recv_cb)(const uint8_t *msg, size_t msg_len, - const int *fds, + int *fds, size_t num_fds, void *private_data), void *recv_cb_private_data); |