diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-04-21 13:46:36 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-04-21 15:16:03 +0200 |
commit | c0b518efde7edc63eed68a4f94dc02cdaa6013c7 (patch) | |
tree | 5f7605d8f0921759d19c342c4048336f6678a9e8 /tests/resume-dtls.c | |
parent | 5b02933f0eed96b0bb15be9ad81021f5b27f2a9b (diff) | |
download | gnutls-c0b518efde7edc63eed68a4f94dc02cdaa6013c7.tar.gz |
tests: resume: check for signals
Diffstat (limited to 'tests/resume-dtls.c')
-rw-r--r-- | tests/resume-dtls.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/resume-dtls.c b/tests/resume-dtls.c index 871b9c79a8..8f80b12256 100644 --- a/tests/resume-dtls.c +++ b/tests/resume-dtls.c @@ -48,6 +48,7 @@ int main(int argc, char **argv) #include <unistd.h> #include <gnutls/gnutls.h> #include <gnutls/dtls.h> +#include <sys/wait.h> #include <signal.h> #include "utils.h" @@ -390,6 +391,7 @@ void doit(void) { int i; + signal(SIGCHLD, SIG_IGN); signal(SIGPIPE, SIG_IGN); for (i = 0; resume_tests[i].desc; i++) { @@ -420,26 +422,22 @@ void doit(void) } if (child) { - int status; + int status = 0; /* parent */ for (j = 0; j < SESSIONS; j++) close(client_sds[j]); server(server_sds, &resume_tests[i]); wait(&status); - if (WEXITSTATUS(status) > 0) - error_count++; + if (WEXITSTATUS(status) != 0 || (WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV)) + exit(1); global_stop(); - if (error_count) - exit(1); } else { for (j = 0; j < SESSIONS; j++) close(server_sds[j]); client(client_sds, &resume_tests[i]); gnutls_global_deinit(); - if (error_count) - exit(1); exit(0); } } |