fix #3926: ignore close() errors other than EBADF

This commit is contained in:
Christian Grothoff committed 2015-08-02 17:11:48 +00:00
1 parent 07b65da99f
commit 58b30e7e5e
13 files changed
+195 -177

No files matched your search

+6 -6
View File
@@ -19,7 +19,7 @@
*/
/**
* @file mhds_get_test.c
* @file test_https_time_out.c
* @brief: daemon TLS alert response test-case
*
* @author Sagie Amir
@@ -69,7 +69,7 @@ test_tls_session_time_out (gnutls_session_t session)
if (ret < 0)
{
fprintf (stderr, "Error: %s\n", MHD_E_FAILED_TO_CONNECT);
close (sd);
MHD_socket_close_ (sd);
return -1;
}
@@ -77,7 +77,7 @@ test_tls_session_time_out (gnutls_session_t session)
if (ret < 0)
{
fprintf (stderr, "Handshake failed\n");
close (sd);
MHD_socket_close_ (sd);
return -1;
}
@@ -88,11 +88,11 @@ test_tls_session_time_out (gnutls_session_t session)
if (send (sd, "", 1, 0) == 0)
{
fprintf (stderr, "Connection failed to time-out\n");
close (sd);
MHD_socket_close_ (sd);
return -1;
}
close (sd);
MHD_socket_close_ (sd);
return 0;
}
@@ -123,7 +123,7 @@ main (int argc, char *const *argv)
MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
MHD_OPTION_END);
if (d == NULL)
if (NULL == d)
{
fprintf (stderr, MHD_E_SERVER_INIT);
return -1;