tools: Target and matches preparation function moves in iptables_test
[framework/connectivity/connman.git] / tools / alg-test.c
index 7ab740e..a7404b7 100644 (file)
@@ -23,6 +23,7 @@
 #include <config.h>
 #endif
 
+#define _GNU_SOURCE
 #include <stdio.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -85,7 +86,7 @@ static int create_socket(void)
        };
        int sk, nsk;
 
-       sk = socket(PF_ALG, SOCK_SEQPACKET, 0);
+       sk = socket(PF_ALG, SOCK_SEQPACKET | SOCK_CLOEXEC, 0);
        if (sk < 0) {
                perror("Failed to create socket");
                return -1;