summaryrefslogtreecommitdiff
path: root/main/php_open_temporary_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/php_open_temporary_file.c')
-rw-r--r--main/php_open_temporary_file.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c
index 9911a69233..ed4af333ee 100644
--- a/main/php_open_temporary_file.c
+++ b/main/php_open_temporary_file.c
@@ -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;
}