tests: status-request: cleanup
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 7 Jun 2019 14:35:11 +0000 (16:35 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 3 Jul 2019 18:58:45 +0000 (20:58 +0200)
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
tests/status-request-ext.c
tests/status-request-ok.c
tests/status-request.c

index e893c5c52887c6533ad275f7295661507b39801f..d5d7b9922f8270760d1b1ba1808ab5961384b3be 100644 (file)
@@ -49,8 +49,6 @@ int main()
 #include "cert-common.h"
 #include "utils.h"
 
-static void terminate(void);
-
 /* This program tests that the server does not send the
  * status request extension if no status response exists. That
  * is to provide compatibility with gnutls 3.3.x which requires
@@ -200,7 +198,6 @@ static void client(int fd)
 
        if (ret < 0) {
                fail("client: Handshake failed: %s\n", gnutls_strerror(ret));
-               terminate();
        } else {
                if (debug)
                        success("client: Handshake was completed\n");
@@ -225,15 +222,6 @@ static void client(int fd)
 }
 
 
-/* These are global */
-pid_t child;
-
-static void terminate(void)
-{
-       kill(child, SIGTERM);
-       exit(1);
-}
-
 static void server(int fd)
 {
        int ret;
@@ -311,6 +299,7 @@ static void ch_handler(int sig)
 
 void doit(void)
 {
+       pid_t child;
        int fd[2];
        int ret, status = 0;
 
index 5dda6faf4f23e249ef12659b9196f87b108fd57f..fe1818eeeefb1536d687c32b93a00d18f587169f 100644 (file)
@@ -49,8 +49,6 @@ int main()
 
 #include "utils.h"
 
-static void terminate(void);
-
 /* This program tests the status request extension and that receiving the
  * certificate status works.
  */
@@ -181,7 +179,6 @@ static void client(int fd)
 
        if (ret < 0) {
                fail("client: Handshake failed: %s\n", gnutls_strerror(ret));
-               terminate();
        } else {
                if (debug)
                        success("client: Handshake was completed\n");
@@ -194,7 +191,6 @@ static void client(int fd)
 
        if (received == 0) {
                fail("client: didn't receive status request\n");
-               terminate();
        }
 
        gnutls_bye(session, GNUTLS_SHUT_WR);
@@ -211,15 +207,6 @@ static void client(int fd)
 }
 
 
-/* These are global */
-pid_t child;
-
-static void terminate(void)
-{
-       kill(child, SIGTERM);
-       exit(1);
-}
-
 static void server(int fd)
 {
        int ret;
@@ -300,6 +287,7 @@ static void ch_handler(int sig)
 
 void doit(void)
 {
+       pid_t child;
        int fd[2];
        int ret, status = 0;
 
index 2ab57727cd91b69d7eb6b20234f2dabb93c61113..0e62969ba9eb5256b105a81f82a85ccb88f657da 100644 (file)
@@ -51,8 +51,6 @@ int main()
 #include "cert-common.h"
 #include "utils.h"
 
-static void terminate(void);
-
 /* This program tests that the client does not send the
  * status request extension if GNUTLS_NO_EXTENSIONS is set.
  */
@@ -133,7 +131,6 @@ static void client(int fd, const char *prio)
 
        if (ret < 0) {
                fail("client: Handshake failed: %s\n", gnutls_strerror(ret));
-               terminate();
        } else {
                if (debug)
                        success("client: Handshake was completed\n");
@@ -158,7 +155,6 @@ static void client(int fd, const char *prio)
                goto end;
        } else if (ret < 0) {
                fail("client: Error: %s\n", gnutls_strerror(ret));
-               terminate();
        }
 
        gnutls_bye(session, GNUTLS_SHUT_WR);
@@ -175,15 +171,6 @@ static void client(int fd, const char *prio)
 }
 
 
-/* These are global */
-pid_t child;
-
-static void terminate(void)
-{
-       kill(child, SIGTERM);
-       exit(1);
-}
-
 static void server(int fd, const char *prio)
 {
        int ret;
@@ -261,6 +248,7 @@ static void ch_handler(int sig)
 static
 void start(const char *prio)
 {
+       pid_t child;
        int fd[2];
        int ret, status = 0;