]> granicus.if.org Git - php/commitdiff
Merge the temp file mode fix from the branch,
authorWez Furlong <wez@php.net>
Mon, 18 Nov 2002 11:49:06 +0000 (11:49 +0000)
committerWez Furlong <wez@php.net>
Mon, 18 Nov 2002 11:49:06 +0000 (11:49 +0000)
add missing Id tag.

main/php_open_temporary_file.c

index 9911a6923343e9abb0982a77766565fcc61ed006..ed4af333ee3be1c34f48d2e9f94988cc1ec89375 100644 (file)
@@ -16,6 +16,8 @@
    +----------------------------------------------------------------------+
  */
 
+/* $Id$ */
+
 #include "php.h"
 
 #include <errno.h>
@@ -130,7 +132,7 @@ static FILE *php_do_open_temporary_file(const char *path, const char *pfx, char
 
 #ifdef PHP_WIN32
        if (GetTempFileName(path, pfx, 0, opened_path)) {
-               fp = VCWD_FOPEN(opened_path, "wb");
+               fp = VCWD_FOPEN(opened_path, "r+b");
        } else {
                fp = NULL;
        }
@@ -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;
        }