The branch, master has been updated via 057a956 tests: Clean-up max_sockets test case from 63d83be swrap: Fix use-after-free
https://git.samba.org/?p=socket_wrapper.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 057a956ad4cfe2bc6e03ec9033a8a9b15e8c88a1 Author: Anoop C S <anoo...@redhat.com> Date: Fri Sep 23 12:38:31 2016 +0530 tests: Clean-up max_sockets test case Signed-off-by: Anoop C S <anoo...@redhat.com> Reviewed-by: Michael Adam <ob...@samba.org> Reviewed-by: Andreas Schneider <a...@samba.org> ----------------------------------------------------------------------- Summary of changes: tests/test_max_sockets.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) Changeset truncated at 500 lines: diff --git a/tests/test_max_sockets.c b/tests/test_max_sockets.c index 0aac181..0bc694b 100644 --- a/tests/test_max_sockets.c +++ b/tests/test_max_sockets.c @@ -1,24 +1,10 @@ -#include <stdarg.h> -#include <stddef.h> -#include <setjmp.h> -#include <cmocka.h> - -#include "config.h" #include "torture.h" #include <errno.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/un.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <stdlib.h> #include <stdio.h> +#include <cmocka.h> #include <unistd.h> -#ifdef HAVE_RPC_RPC_H -#include <rpc/rpc.h> -#endif - +#include <stdlib.h> #define MAX_SOCKETS 4 @@ -52,14 +38,12 @@ static int _socket(int *_s) s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if (_s != NULL) { - *_s = s; - } - if (s < 0) { return -1; } + *_s = s; + return 0; } -- Socket Wrapper Repository