From b1b134084f96ba0765241091c47c6187f57f9867 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 11 Jun 2005 02:26:53 +0000 Subject: r7476: ensure dgram sockets are created non-blocking. As they usually skip the connect() stage, we were missing this (This used to be commit f5102b886c10fead0f6bcdc4460584ae53912ebc) --- source4/lib/socket/socket.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/lib/socket/socket.c') diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c index dd3175468d..39379be678 100644 --- a/source4/lib/socket/socket.c +++ b/source4/lib/socket/socket.c @@ -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; -- cgit