1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-07 12:23:51 +03:00

r7476: ensure dgram sockets are created non-blocking. As they usually skip

the connect() stage, we were missing this
This commit is contained in:
Andrew Tridgell
2005-06-11 02:26:53 +00:00
committed by Gerald (Jerry) Carter
parent 71bf781227
commit f5102b886c

View File

@@ -69,6 +69,12 @@ static NTSTATUS socket_create_with_ops(TALLOC_CTX *mem_ctx, const struct socket_
(*new_sock)->flags |= SOCKET_FLAG_TESTNONBLOCK;
}
/* we don't do a connect() on dgram sockets, so need to set
non-blocking at socket create time */
if (!(flags & SOCKET_FLAG_BLOCK) && type == SOCKET_TYPE_DGRAM) {
set_blocking(socket_get_fd(*new_sock), False);
}
talloc_set_destructor(*new_sock, socket_destructor);
return NT_STATUS_OK;