summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-11-24 08:17:40 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2017-11-24 22:16:54 +0100
commit095a421c26131838035f6208a25737b160575a53 (patch)
treec9eb39910ca41665eaf061cf6b5545f6fcbcc314 /tests
parent2eaa67c18a7008b38628e2d798b954c513c3666d (diff)
downloadgnutls-095a421c26131838035f6208a25737b160575a53.tar.gz
tests: client-fastopen: introduce child signal handler and delay prior to starting
This addresses a hang issue on freebsd builds. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/client-fastopen.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/client-fastopen.c b/tests/client-fastopen.c
index 9211c44a7c..61df827bff 100644
--- a/tests/client-fastopen.c
+++ b/tests/client-fastopen.c
@@ -103,8 +103,7 @@ static void client(int fd, struct sockaddr *connect_addr, socklen_t connect_addr
while (ret < 0 && gnutls_error_is_fatal(ret) == 0);
if (ret < 0) {
- fail("client: Handshake failed\n");
- gnutls_perror(ret);
+ fail("client: Handshake failed: %s\n", gnutls_strerror(ret));
exit(1);
} else {
if (debug)
@@ -152,10 +151,7 @@ pid_t child;
static void terminate(void)
{
- int status;
-
kill(child, SIGTERM);
- wait(&status);
exit(1);
}
@@ -248,6 +244,11 @@ static void server(int fd)
success("server: finished\n");
}
+static void ch_handler(int sig)
+{
+ return;
+}
+
void doit(void)
{
int ret;
@@ -256,6 +257,7 @@ void doit(void)
int listener;
int fd;
+ signal(SIGCHLD, ch_handler);
signal(SIGPIPE, SIG_IGN);
listener = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
@@ -302,6 +304,7 @@ void doit(void)
} else {
fd = socket(AF_INET, SOCK_STREAM, 0);
+ usleep(1000000);
client(fd, (struct sockaddr*)&saddr, addrlen);
exit(0);
}