mk: build with _GNU_SOURCE defined by default
[dpdk.git] / examples / ip_pipeline / conn.c
index 9338942..30fca80 100644 (file)
@@ -8,7 +8,6 @@
 #include <unistd.h>
 #include <sys/types.h>
 
-#define __USE_GNU
 #include <sys/socket.h>
 
 #include <sys/epoll.h>
@@ -96,12 +95,14 @@ conn_init(struct conn_params *p)
                sizeof(server_address));
        if (status == -1) {
                conn_free(conn);
+               close(fd_server);
                return NULL;
        }
 
        status = listen(fd_server, 16);
        if (status == -1) {
                conn_free(conn);
+               close(fd_server);
                return NULL;
        }
 
@@ -109,6 +110,7 @@ conn_init(struct conn_params *p)
        fd_client_group = epoll_create(1);
        if (fd_client_group == -1) {
                conn_free(conn);
+               close(fd_server);
                return NULL;
        }