From: Nikos Mavrogiannopoulos Date: Fri, 25 Oct 2013 07:31:51 +0000 (+0200) Subject: Applied small patch by Jeremie Courreges-Anglas to avoid usage of error(). X-Git-Tag: gnutls_3_2_6~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6842a2ae042ab939d428248f8a7ef75aaf93e1c0;p=thirdparty%2Fgnutls.git Applied small patch by Jeremie Courreges-Anglas to avoid usage of error(). --- diff --git a/tests/chainverify.c b/tests/chainverify.c index e7e51bbcc1..8f6d78466b 100644 --- a/tests/chainverify.c +++ b/tests/chainverify.c @@ -26,7 +26,6 @@ #include #include -#include #include #include @@ -810,7 +809,7 @@ doit (void) if (ret != 0) { fail ("%d: %s\n", ret, gnutls_strerror (ret)); - exit (EXIT_FAILURE); + exit (1); } gnutls_global_set_time_function (mytime); @@ -836,8 +835,11 @@ doit (void) ret = gnutls_x509_crt_init (&certs[j]); if (ret < 0) - error (EXIT_FAILURE, 0, "gnutls_x509_crt_init[%d,%d]: %s", - (int) i, (int) j, gnutls_strerror (ret)); + { + fprintf (stderr, "gnutls_x509_crt_init[%d,%d]: %s", + (int) i, (int) j, gnutls_strerror (ret)); + exit (1); + } tmp.data = (unsigned char *) chains[i].chain[j]; tmp.size = strlen (chains[i].chain[j]); @@ -846,8 +848,11 @@ doit (void) if (debug > 2) printf ("done\n"); if (ret < 0) - error (EXIT_FAILURE, 0, "gnutls_x509_crt_import[%d,%d]: %s", - (int) i, (int) j, gnutls_strerror (ret)); + { + fprintf (stderr, "gnutls_x509_crt_import[%d,%d]: %s", + (int) i, (int) j, gnutls_strerror (ret)); + exit (1); + } gnutls_x509_crt_print (certs[j], GNUTLS_CRT_PRINT_ONELINE, &tmp); if (debug) @@ -860,16 +865,22 @@ doit (void) ret = gnutls_x509_crt_init (&ca); if (ret < 0) - error (EXIT_FAILURE, 0, "gnutls_x509_crt_init: %s", - gnutls_strerror (ret)); + { + fprintf (stderr, "gnutls_x509_crt_init: %s", + gnutls_strerror (ret)); + exit (1); + } tmp.data = (unsigned char *) *chains[i].ca; tmp.size = strlen (*chains[i].ca); ret = gnutls_x509_crt_import (ca, &tmp, GNUTLS_X509_FMT_PEM); if (ret < 0) - error (EXIT_FAILURE, 0, "gnutls_x509_crt_import: %s", - gnutls_strerror (ret)); + { + fprintf (stderr, "gnutls_x509_crt_import: %s", + gnutls_strerror (ret)); + exit (1); + } if (debug > 2) printf ("done\n"); @@ -887,8 +898,11 @@ doit (void) chains[i].verify_flags, &verify_status); if (ret < 0) - error (EXIT_FAILURE, 0, "gnutls_x509_crt_list_verify[%d,%d]: %s", - (int) i, (int) j, gnutls_strerror (ret)); + { + fprintf (stderr, "gnutls_x509_crt_list_verify[%d,%d]: %s", + (int) i, (int) j, gnutls_strerror (ret)); + exit (1); + } if (verify_status != chains[i].expected_verify_result) {