docs: fix a typo in history file
[bbaumbach/samba-autobuild/.git] / source4 / lib / socket / socket.c
index 42eb53abcef7874524436d4dc13e2f6aca13fc4d..26f23f5665366a43e01df889146c3239ccd89e9d 100644 (file)
@@ -79,15 +79,14 @@ _PUBLIC_ NTSTATUS socket_create_with_ops(TALLOC_CTX *mem_ctx, const struct socke
           send calls on non-blocking sockets will randomly recv/send
           less data than requested */
 
-       if (!(flags & SOCKET_FLAG_BLOCK) &&
-           type == SOCKET_TYPE_STREAM &&
+       if (type == SOCKET_TYPE_STREAM &&
                getenv("SOCKET_TESTNONBLOCK") != NULL) {
                (*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) {
+       if (type == SOCKET_TYPE_DGRAM) {
                set_blocking(socket_get_fd(*new_sock), false);
        }
 
@@ -96,7 +95,8 @@ _PUBLIC_ NTSTATUS socket_create_with_ops(TALLOC_CTX *mem_ctx, const struct socke
        return NT_STATUS_OK;
 }
 
-_PUBLIC_ NTSTATUS socket_create(const char *name, enum socket_type type, 
+_PUBLIC_ NTSTATUS socket_create(TALLOC_CTX *mem_ctx,
+                               const char *name, enum socket_type type,
                                struct socket_context **new_sock, uint32_t flags)
 {
        const struct socket_ops *ops;
@@ -106,7 +106,7 @@ _PUBLIC_ NTSTATUS socket_create(const char *name, enum socket_type type,
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       return socket_create_with_ops(NULL, ops, new_sock, type, flags);
+       return socket_create_with_ops(mem_ctx, ops, new_sock, type, flags);
 }
 
 _PUBLIC_ NTSTATUS socket_connect(struct socket_context *sock,
@@ -618,7 +618,7 @@ _PUBLIC_ const struct socket_ops *socket_getops_byname(const char *family, enum
                return socket_ipv4_ops(type);
        }
 
-#if HAVE_IPV6
+#ifdef HAVE_IPV6
        if (strcmp("ipv6", family) == 0) {
                return socket_ipv6_ops(type);
        }