]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: improved x509dn check
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 20 Apr 2015 14:46:34 +0000 (16:46 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 20 Apr 2015 15:37:38 +0000 (17:37 +0200)
tests/x509dn.c

index df43138824c27066e79c91c5962b38bd5ee8aa7b..4263265bdc2275f54678d1d0b2a1a31ca4514d31 100644 (file)
@@ -47,6 +47,7 @@ int main(int argc, char **argv)
 #include <sys/wait.h>
 #endif
 #include <unistd.h>
+#include <signal.h>
 #include <gnutls/gnutls.h>
 #include <gnutls/abstract.h>
 
@@ -456,6 +457,8 @@ void doit(void)
        int sockets[2];
        int err;
 
+       signal(SIGPIPE, SIG_IGN);
+
        err = socketpair(AF_UNIX, SOCK_STREAM, 0, sockets);
        if (err == -1) {
                perror("socketpair");
@@ -473,6 +476,7 @@ void doit(void)
        if (child) {
                int status;
                /* parent */
+               close(sockets[1]);
                server(sockets[0]);
                wait(&status);
 
@@ -489,8 +493,10 @@ void doit(void)
                }
 #endif
 
-       } else
+       } else {
+               close(sockets[0]);
                client(sockets[1]);
+       }
 }
 
 #endif                         /* _WIN32 */