libressl-portable/patches/tls_config.c.patch

26 lines
631 B
Diff

--- tls/tls_config.c.orig Fri Jul 26 22:16:53 2019
+++ tls/tls_config.c Fri Jul 26 22:21:25 2019
@@ -15,6 +15,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef _MSC_VER
+#define NO_REDEF_POSIX_FUNCTIONS
+#endif
+
#include <sys/stat.h>
#include <ctype.h>
@@ -48,7 +52,11 @@ tls_config_load_file(struct tls_error *error, const ch
*buf = NULL;
*len = 0;
+#ifndef _WIN32
if ((fd = open(filename, O_RDONLY)) == -1) {
+#else
+ if ((fd = open(filename, O_RDONLY | O_BINARY)) == -1) {
+#endif
tls_error_set(error, "failed to open %s file '%s'",
filetype, filename);
goto err;