]> granicus.if.org Git - curl/commitdiff
cmake: Add missing setmode check
authorJohn Starks <jostarks@ntdev.microsoft.com>
Fri, 10 Nov 2017 19:46:41 +0000 (11:46 -0800)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 10 Nov 2017 20:38:23 +0000 (15:38 -0500)
Ensure HAVE_SETMODE is set to 1 on OSes that have setmode. Without this,
curl will corrupt binary files when writing them to stdout on Windows.

Closes https://github.com/curl/curl/pull/2067

CMakeLists.txt

index 3aaeb346e702b9f704c7249e778f943ee074a606..7b73b98f7c1d6e261faee69f7a44b97e107c0039 100644 (file)
@@ -874,6 +874,7 @@ check_symbol_exists(ftruncate      "${CURL_INCLUDES}" HAVE_FTRUNCATE)
 check_symbol_exists(getprotobyname "${CURL_INCLUDES}" HAVE_GETPROTOBYNAME)
 check_symbol_exists(getrlimit      "${CURL_INCLUDES}" HAVE_GETRLIMIT)
 check_symbol_exists(setlocale      "${CURL_INCLUDES}" HAVE_SETLOCALE)
+check_symbol_exists(setmode        "${CURL_INCLUDES}" HAVE_SETMODE)
 check_symbol_exists(setrlimit      "${CURL_INCLUDES}" HAVE_SETRLIMIT)
 check_symbol_exists(fcntl          "${CURL_INCLUDES}" HAVE_FCNTL)
 check_symbol_exists(ioctl          "${CURL_INCLUDES}" HAVE_IOCTL)