]> granicus.if.org Git - php/commitdiff
fixed binary mode for Win32
authorThies C. Arntzen <thies@php.net>
Mon, 7 Aug 2000 12:01:52 +0000 (12:01 +0000)
committerThies C. Arntzen <thies@php.net>
Mon, 7 Aug 2000 12:01:52 +0000 (12:01 +0000)
ext/oci8/oci8.c

index 507acd718d78003710a0c4c08a6650f41efa3ff2..99708205a93980e91264f6d491c37182a63d6497 100644 (file)
@@ -80,6 +80,9 @@ static zend_class_entry *oci_lob_class_entry_ptr;
 
 #include <fcntl.h>
 
+#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;
                        }