tests: Clean-up max_sockets test case master
authorAnoop C S <anoopcs@redhat.com>
Fri, 23 Sep 2016 07:08:31 +0000 (12:38 +0530)
committerMichael Adam <obnox@samba.org>
Thu, 27 Oct 2016 13:45:46 +0000 (15:45 +0200)
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
tests/test_max_sockets.c

index 0aac181c71d5119c9377512a31219f8e8a1cca22..0bc694b073a75492a9dbe7e4e900746706c61a80 100644 (file)
@@ -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;
 }