}
static NTSTATUS unixdom_accept(struct socket_context *sock,
- struct socket_context **new_sock,
- uint32_t flags)
+ struct socket_context **new_sock)
{
struct sockaddr_un cli_addr;
socklen_t cli_addr_len = sizeof(cli_addr);
return unixdom_error(errno);
}
+ if (!(sock->flags & SOCKET_FLAG_BLOCK)) {
+ int ret = set_blocking(new_fd, False);
+ if (ret == -1) {
+ close(new_fd);
+ return map_nt_error_from_unix(errno);
+ }
+ }
+
(*new_sock) = talloc_p(NULL, struct socket_context);
if (!(*new_sock)) {
close(new_fd);
/* copy the socket_context */
(*new_sock)->type = sock->type;
(*new_sock)->state = SOCKET_STATE_SERVER_CONNECTED;
- (*new_sock)->flags = flags;
+ (*new_sock)->flags = sock->flags;
(*new_sock)->fd = new_fd;