summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/x509dn.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/x509dn.c b/tests/x509dn.c
index df43138824..4263265bdc 100644
--- a/tests/x509dn.c
+++ b/tests/x509dn.c
@@ -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 */