cvs: php4 /ext/session mod_files.c
| From: | Stanislav Malyshev | Date: | Sat, 05 Aug 2000 10:25:00 +0000 |
| Subject: | cvs: php4 /ext/session mod_files.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1046@lists.php.net to get a copy of this message | ||
stas Sat Aug 5 03:25:00 2000 EDT
Modified files:
/php4/ext/session mod_files.c
Log:
Open session files in binary mode (fix #5953)
@- Fixed \n in session variables bug on Win32 (Stas)
Index: php4/ext/session/mod_files.c
diff -u php4/ext/session/mod_files.c:1.39 php4/ext/session/mod_files.c:1.40
--- php4/ext/session/mod_files.c:1.39 Tue Jul 11 05:29:19 2000
+++ php4/ext/session/mod_files.c Sat Aug 5 03:25:00 2000
@@ -110,6 +110,10 @@
return buf;
}
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
static void _ps_files_open(ps_files *data, const char *key)
{
char buf[MAXPATHLEN];
@@ -131,16 +135,16 @@
data->lastkey = estrdup(key);
#ifdef O_EXCL
- data->fd = V_OPEN((buf, O_RDWR));
+ data->fd = V_OPEN((buf, O_RDWR | O_BINARY));
if (data->fd == -1) {
if (errno == ENOENT) {
- data->fd = V_OPEN((buf, O_EXCL | O_RDWR | O_CREAT, 0600));
+ data->fd = V_OPEN((buf, O_EXCL | O_RDWR | O_CREAT | O_BINARY, 0600));
}
} else {
flock(data->fd, LOCK_EX);
}
#else
- data->fd = V_OPEN((buf, O_CREAT | O_RDWR, 0600));
+ data->fd = V_OPEN((buf, O_CREAT | O_RDWR | O_BINARY, 0600));
if (data->fd != -1)
flock(data->fd, LOCK_EX);
#endif