[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 37/163: Fix the test for fsetxattr and strerror_r t
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 37/163: Fix the test for fsetxattr and strerror_r tests in CMake to work without compiling |
Date: |
Sun, 05 Aug 2018 12:36:03 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 7e93637acd9f5741ac4c09bbca353ac8da42bb17
Author: maxed <address@hidden>
AuthorDate: Sat Mar 31 13:17:45 2018 +0300
Fix the test for fsetxattr and strerror_r tests in CMake to work without
compiling
---
CMake/CurlTests.c | 30 +++++++++++++++---------------
CMakeLists.txt | 4 ++--
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/CMake/CurlTests.c b/CMake/CurlTests.c
index bc36c8ef7..ac959f340 100644
--- a/CMake/CurlTests.c
+++ b/CMake/CurlTests.c
@@ -507,30 +507,30 @@ main ()
#ifdef HAVE_GLIBC_STRERROR_R
#include <string.h>
#include <errno.h>
+
+void check(char c) {}
+
int
main () {
- char buffer[1024]; /* big enough to play with */
- char *string =
- strerror_r(EACCES, buffer, sizeof(buffer));
- /* this should've returned a string */
- if(!string || !string[0])
- return 99;
- return 0;
+ char buffer[1024];
+ // This will not compile if strerror_r does not return a char*
+ check(strerror_r(EACCES, buffer, sizeof(buffer))[0]);
+ return 0;
}
#endif
#ifdef HAVE_POSIX_STRERROR_R
#include <string.h>
#include <errno.h>
+
+// float, because a pointer can't be implicitly cast to float
+void check(float f) {}
+
int
main () {
- char buffer[1024]; /* big enough to play with */
- int error =
- strerror_r(EACCES, buffer, sizeof(buffer));
- /* This should've returned zero, and written an error string in the
- buffer.*/
- if(!buffer[0] || error)
- return 99;
- return 0;
+ char buffer[1024];
+ // This will not compile if strerror_r does not return an int
+ check(strerror_r(EACCES, buffer, sizeof(buffer)));
+ return 0;
}
#endif
#ifdef HAVE_FSETXATTR_6
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b8c79f88a..685faf934 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -902,7 +902,7 @@ endif()
check_symbol_exists(fsetxattr "${CURL_INCLUDES}" HAVE_FSETXATTR)
if(HAVE_FSETXATTR)
foreach(CURL_TEST HAVE_FSETXATTR_5 HAVE_FSETXATTR_6)
- curl_internal_test_run(${CURL_TEST})
+ curl_internal_test(${CURL_TEST})
endforeach(CURL_TEST)
endif(HAVE_FSETXATTR)
@@ -982,7 +982,7 @@ foreach(CURL_TEST
HAVE_GLIBC_STRERROR_R
HAVE_POSIX_STRERROR_R
)
- curl_internal_test_run(${CURL_TEST})
+ curl_internal_test(${CURL_TEST})
endforeach(CURL_TEST)
# Check for reentrant
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 38/163: mailmap: Max Savenkov, (continued)
- [GNUnet-SVN] [gnurl] 38/163: mailmap: Max Savenkov, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 31/163: multi: provide a socket to wait for in Curl_protocol_getsock, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 41/163: cmdline-opts/gen.pl: warn if mutexes: or see-also: list non-existing options, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 44/163: configure: fix ssh2 linking when built with a static mbedtls, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 67/163: curl_addrinfo: use same #ifdef conditions in source as header, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 33/163: winbuild: only delete OUTFILE if it exists, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 36/163: mailmap: a Richard Alcock fixup, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 17/163: curl: show headers in bold, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 19/163: checksrc: make sure sizeof() is used *with* parentheses, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 27/163: configure: add basic test of --with-ssl prefix, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 37/163: Fix the test for fsetxattr and strerror_r tests in CMake to work without compiling,
gnunet <=
- [GNUnet-SVN] [gnurl] 50/163: configure: override AR_FLAGS to silence warning, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 47/163: KNOWN_BUGS: restore text regarding #2101., gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 40/163: curl.1: Fix cmdline-opts reference errors., gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 60/163: configure: check for declaration of getpwuid_r, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 39/163: docs: fix cmdline-opts metadata headers case consistency., gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 26/163: http resume: skip body if http code 416 (range error) is ignored., gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 29/163: TODO: CURLINFO_PAUSE_STATE, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 59/163: tests: update .gitignore for libtests, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 72/163: cmdline-opts/cert-type.d: mention "p12" as a recognized type as well, gnunet, 2018/08/05
- [GNUnet-SVN] [gnurl] 75/163: tests/libtests/Makefile.am: Add lib1521.c to CLEANFILES, gnunet, 2018/08/05