From e05fbd00c2d63b37c4c3de14dc02e78b40ea310d Mon Sep 17 00:00:00 2001 From: "Thies C. Arntzen" Date: Mon, 7 Aug 2000 12:01:52 +0000 Subject: [PATCH] fixed binary mode for Win32 --- ext/oci8/oci8.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 507acd718d..99708205a9 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -80,6 +80,9 @@ static zend_class_entry *oci_lob_class_entry_ptr; #include +#ifndef O_BINARY +#define O_BINARY 0 +#endif /* }}} */ /* {{{ thread safety stuff */ @@ -2698,7 +2701,7 @@ PHP_FUNCTION(ocisavelobfile) filename = (*arg)->value.str.val; - if ((fp = V_OPEN((filename, O_RDONLY))) == -1) { + if ((fp = V_OPEN((filename, O_RDONLY|O_BINARY))) == -1) { php_error(E_WARNING, "Can't open file %s", filename); RETURN_FALSE; } @@ -2820,7 +2823,7 @@ PHP_FUNCTION(ociwritelobtofile) goto bail; } - if ((fp = V_OPEN((filename,O_CREAT|O_TRUNC|O_WRONLY))) == -1) { + if ((fp = V_OPEN((filename,O_CREAT | O_RDWR | O_BINARY | O_TRUNC, 0600))) == -1) { php_error(E_WARNING, "Can't create file %s", filename); goto bail; } -- 2.50.1