docs: fix a typo in history file
[bbaumbach/samba-autobuild/.git] / source4 / lib / socket / socket_ip.c
index 2aba491e06cc1a4cf62a3aaad76126a480745da2..62dbf1d2213431fbbbe63b13d8bff033a214c718 100644 (file)
@@ -27,6 +27,8 @@
 #include "system/network.h"
 #include "lib/util/util_net.h"
 
+#undef strcasecmp
+
 _PUBLIC_ const struct socket_ops *socket_ipv4_ops(enum socket_type type);
 _PUBLIC_ const struct socket_ops *socket_ipv6_ops(enum socket_type type);
 
@@ -81,11 +83,9 @@ static NTSTATUS ip_connect_complete(struct socket_context *sock, uint32_t flags)
                return map_nt_error_from_unix_common(error);
        }
 
-       if (!(flags & SOCKET_FLAG_BLOCK)) {
-               ret = set_blocking(sock->fd, false);
-               if (ret == -1) {
-                       return map_nt_error_from_unix_common(errno);
-               }
+       ret = set_blocking(sock->fd, false);
+       if (ret == -1) {
+               return map_nt_error_from_unix_common(errno);
        }
 
        sock->state = SOCKET_STATE_CLIENT_CONNECTED;
@@ -201,11 +201,9 @@ static NTSTATUS ipv4_listen(struct socket_context *sock,
                }
        }
 
-       if (!(flags & SOCKET_FLAG_BLOCK)) {
-               ret = set_blocking(sock->fd, false);
-               if (ret == -1) {
-                       return map_nt_error_from_unix_common(errno);
-               }
+       ret = set_blocking(sock->fd, false);
+       if (ret == -1) {
+               return map_nt_error_from_unix_common(errno);
        }
 
        sock->state= SOCKET_STATE_SERVER_LISTEN;
@@ -217,7 +215,7 @@ static NTSTATUS ipv4_accept(struct socket_context *sock, struct socket_context *
 {
        struct sockaddr_in cli_addr;
        socklen_t cli_addr_len = sizeof(cli_addr);
-       int new_fd;
+       int new_fd, ret;
 
        if (sock->type != SOCKET_TYPE_STREAM) {
                return NT_STATUS_INVALID_PARAMETER;
@@ -228,13 +226,12 @@ static NTSTATUS ipv4_accept(struct socket_context *sock, struct socket_context *
                return map_nt_error_from_unix_common(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_common(errno);
-               }
+       ret = set_blocking(new_fd, false);
+       if (ret == -1) {
+               close(new_fd);
+               return map_nt_error_from_unix_common(errno);
        }
+
        smb_set_close_on_exec(new_fd);
 
 
@@ -731,11 +728,9 @@ static NTSTATUS ipv6_listen(struct socket_context *sock,
                }
        }
 
-       if (!(flags & SOCKET_FLAG_BLOCK)) {
-               ret = set_blocking(sock->fd, false);
-               if (ret == -1) {
-                       return map_nt_error_from_unix_common(errno);
-               }
+       ret = set_blocking(sock->fd, false);
+       if (ret == -1) {
+               return map_nt_error_from_unix_common(errno);
        }
 
        sock->state= SOCKET_STATE_SERVER_LISTEN;
@@ -747,7 +742,7 @@ static NTSTATUS ipv6_tcp_accept(struct socket_context *sock, struct socket_conte
 {
        struct sockaddr_in6 cli_addr;
        socklen_t cli_addr_len = sizeof(cli_addr);
-       int new_fd;
+       int new_fd, ret;
        
        if (sock->type != SOCKET_TYPE_STREAM) {
                return NT_STATUS_INVALID_PARAMETER;
@@ -758,12 +753,10 @@ static NTSTATUS ipv6_tcp_accept(struct socket_context *sock, struct socket_conte
                return map_nt_error_from_unix_common(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_common(errno);
-               }
+       ret = set_blocking(new_fd, false);
+       if (ret == -1) {
+               close(new_fd);
+               return map_nt_error_from_unix_common(errno);
        }
        smb_set_close_on_exec(new_fd);