summaryrefslogtreecommitdiff
path: root/tests/x509dn.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2015-04-20 16:46:34 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2015-04-20 17:37:38 +0200
commit4262fbef33c8fb609c1cb8eb189985f921d8d6d1 (patch)
treef84de8a477ac9a77c40c6c3117519366e46ac809 /tests/x509dn.c
parent928e52e0a2ea6ccdbf25d907658c32c7604c94b5 (diff)
downloadgnutls-4262fbef33c8fb609c1cb8eb189985f921d8d6d1.tar.gz
tests: improved x509dn check
Diffstat (limited to 'tests/x509dn.c')
-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 */