summaryrefslogtreecommitdiff
path: root/main/php_open_temporary_file.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2002-11-18 11:49:06 +0000
committerWez Furlong <wez@php.net>2002-11-18 11:49:06 +0000
commit5b7537ecd24e18734126897066c0bf30915ba062 (patch)
tree51f7ec060de42c9450a31c712ed236f829a0b5c6 /main/php_open_temporary_file.c
parentca58966a0d12c21599edb25281ace01caf12f5c1 (diff)
downloadphp-git-5b7537ecd24e18734126897066c0bf30915ba062.tar.gz
Merge the temp file mode fix from the branch,
add missing Id tag.
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;
}