[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] branch master updated: check system call re
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] branch master updated: check system call return values in tests |
Date: |
Fri, 10 Mar 2017 16:38:45 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libmicrohttpd.
The following commit(s) were added to refs/heads/master by this push:
new 91548850 check system call return values in tests
91548850 is described below
commit 91548850d961783a8f5b288c69ce83ecb89d3ddc
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Mar 10 16:40:27 2017 +0100
check system call return values in tests
---
src/examples/fileserver_example.c | 8 +++++---
src/testcurl/https/test_empty_response.c | 8 ++++++--
src/testcurl/https/test_https_get_select.c | 10 +++++++---
3 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/src/examples/fileserver_example.c
b/src/examples/fileserver_example.c
index 4d710575..692e1f34 100644
--- a/src/examples/fileserver_example.c
+++ b/src/examples/fileserver_example.c
@@ -79,7 +79,8 @@ ahc_echo (void *cls,
(! S_ISREG (buf.st_mode)) )
{
/* not a regular file, refuse to serve */
- close (fd);
+ if (0 != close (fd))
+ abort ();
fd = -1;
}
}
@@ -93,10 +94,11 @@ ahc_echo (void *cls,
}
else
{
- response = MHD_create_response_from_fd64(buf.st_size, fd);
+ response = MHD_create_response_from_fd64 (buf.st_size, fd);
if (NULL == response)
{
- close (fd);
+ if (0 != close (fd))
+ abort ();
return MHD_NO;
}
ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
diff --git a/src/testcurl/https/test_empty_response.c
b/src/testcurl/https/test_empty_response.c
index 2acc820f..5fd17bda 100644
--- a/src/testcurl/https/test_empty_response.c
+++ b/src/testcurl/https/test_empty_response.c
@@ -81,7 +81,7 @@ testInternalSelectGet ()
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon (MHD_USE_ERROR_LOG | MHD_USE_TLS |
MHD_USE_INTERNAL_POLLING_THREAD,
- 1082, NULL, NULL, &ahc_echo, "GET",
+ 1082, NULL, NULL, &ahc_echo, "GET",
MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
MHD_OPTION_END);
@@ -149,7 +149,11 @@ testInternalSelectGet ()
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (maxposixs + 1, &rs, &ws, &es, &tv);
+ if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+ {
+ if (EINTR != errno)
+ abort ();
+ }
curl_multi_perform (multi, &running);
if (running == 0)
{
diff --git a/src/testcurl/https/test_https_get_select.c
b/src/testcurl/https/test_https_get_select.c
index 96c1e17e..024c52a4 100644
--- a/src/testcurl/https/test_https_get_select.c
+++ b/src/testcurl/https/test_https_get_select.c
@@ -101,7 +101,7 @@ testExternalGet (int flags)
cbc.size = 2048;
cbc.pos = 0;
d = MHD_start_daemon (MHD_USE_ERROR_LOG | MHD_USE_TLS | flags,
- 1082, NULL, NULL, &ahc_echo, "GET",
+ 1082, NULL, NULL, &ahc_echo, "GET",
MHD_OPTION_HTTPS_MEM_KEY, srv_key_pem,
MHD_OPTION_HTTPS_MEM_CERT, srv_self_signed_cert_pem,
MHD_OPTION_END);
@@ -109,7 +109,7 @@ testExternalGet (int flags)
return 256;
if (curl_uses_nss_ssl() == 0)
- aes256_sha = "rsa_aes_256_sha";
+ aes256_sha = "rsa_aes_256_sha";
c = curl_easy_init ();
curl_easy_setopt (c, CURLOPT_URL, "https://127.0.0.1:1082/hello_world");
@@ -175,7 +175,11 @@ testExternalGet (int flags)
}
tv.tv_sec = 0;
tv.tv_usec = 1000;
- select (maxposixs + 1, &rs, &ws, &es, &tv);
+ if (-1 == select (maxposixs + 1, &rs, &ws, &es, &tv))
+ {
+ if (EINTR != errno)
+ abort ();
+ }
curl_multi_perform (multi, &running);
if (running == 0)
{
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [libmicrohttpd] branch master updated: check system call return values in tests,
gnunet <=