1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

s3:unix_msg: add close_fd_array_cmsg()

Variant of close_fd_array() operating on fd_array inside msghdr.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Michael Adam 2014-09-29 13:31:27 +02:00
parent 20cd934ec0
commit b38ed7311a

View File

@ -177,6 +177,19 @@ static void close_fd_array(int *fds, size_t num_fds)
}
}
static void close_fd_array_cmsg(struct msghdr *msg)
{
int *fds = NULL;
size_t num_fds = 0;
extract_fd_array_from_msghdr(msg, &fds, &num_fds);
/*
* TODO: caveat - side-effect - changing msg ???
*/
close_fd_array(fds, num_fds);
}
static int unix_dgram_init(const struct sockaddr_un *addr, size_t max_msg,
const struct poll_funcs *ev_funcs,
void (*recv_callback)(struct unix_dgram_ctx *ctx,