r3314: added a option "socket:testnonblock" to the generic socket code. If
[bbaumbach/samba-autobuild/.git] / source4 / lib / socket / socket_ipv4.c
index 71e1c62235f9c82b2abc8f6f55709b2144916027..f9318a29bb5e4d7e49e3de024630e489b73e9163 100644 (file)
@@ -130,7 +130,7 @@ static NTSTATUS ipv4_tcp_listen(struct socket_context *sock,
        return NT_STATUS_OK;
 }
 
        return NT_STATUS_OK;
 }
 
-static NTSTATUS ipv4_tcp_accept(struct socket_context *sock, struct socket_context **new_sock, uint32_t flags)
+static NTSTATUS ipv4_tcp_accept(struct socket_context *sock, struct socket_context **new_sock)
 {
        struct sockaddr_in cli_addr;
        socklen_t cli_addr_len = sizeof(cli_addr);
 {
        struct sockaddr_in cli_addr;
        socklen_t cli_addr_len = sizeof(cli_addr);
@@ -141,7 +141,7 @@ static NTSTATUS ipv4_tcp_accept(struct socket_context *sock, struct socket_conte
                return map_nt_error_from_unix(errno);
        }
 
                return map_nt_error_from_unix(errno);
        }
 
-       if (!(flags & SOCKET_FLAG_BLOCK)) {
+       if (!(sock->flags & SOCKET_FLAG_BLOCK)) {
                int ret = set_blocking(new_fd, False);
                if (ret == -1) {
                        close(new_fd);
                int ret = set_blocking(new_fd, False);
                if (ret == -1) {
                        close(new_fd);
@@ -164,7 +164,7 @@ static NTSTATUS ipv4_tcp_accept(struct socket_context *sock, struct socket_conte
        /* copy the socket_context */
        (*new_sock)->type               = sock->type;
        (*new_sock)->state              = SOCKET_STATE_SERVER_CONNECTED;
        /* 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;
 
 
        (*new_sock)->fd                 = new_fd;