]> granicus.if.org Git - php/commitdiff
MFH other temp file mode fixes and Id tag.
authorWez Furlong <wez@php.net>
Mon, 18 Nov 2002 11:50:36 +0000 (11:50 +0000)
committerWez Furlong <wez@php.net>
Mon, 18 Nov 2002 11:50:36 +0000 (11:50 +0000)
main/php_open_temporary_file.c

index e6a83a9c3881c747943df5208c1c18599e8f136c..ed4af333ee3be1c34f48d2e9f94988cc1ec89375 100644 (file)
@@ -16,6 +16,8 @@
    +----------------------------------------------------------------------+
  */
 
+/* $Id$ */
+
 #include "php.h"
 
 #include <errno.h>
@@ -138,7 +140,7 @@ static FILE *php_do_open_temporary_file(const char *path, const char *pfx, char
        /* Using standard mktemp() implementation for NetWare */
        file_path = mktemp(opened_path);
        if (file_path) {
-               fp = VCWD_FOPEN(file_path, "wb");
+               fp = VCWD_FOPEN(file_path, "r+b");
        } else {
                fp = NULL;
        }
@@ -151,7 +153,7 @@ static FILE *php_do_open_temporary_file(const char *path, const char *pfx, char
        }
 #else
        if (mktemp(opened_path)) {
-               fp = VCWD_FOPEN(opened_path, "wb");
+               fp = VCWD_FOPEN(opened_path, "r+b");
        } else {
                fp = NULL;
        }