cvs: php4(PHP_4_0_7) /ext/session mod_mm.c
| From: | Yasuo Ohgaki | Date: | Thu, 10 Jan 2002 06:15:46 +0000 |
| Subject: | cvs: php4(PHP_4_0_7) /ext/session mod_mm.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-9017@lists.php.net to get a copy of this message | ||
yohgaki Thu Jan 10 01:15:46 2002 EDT
Modified files: (Branch: PHP_4_0_7)
/php4/ext/session mod_mm.c
Log:
MFH
Index: php4/ext/session/mod_mm.c
diff -u php4/ext/session/mod_mm.c:1.22.2.1 php4/ext/session/mod_mm.c:1.22.2.2
--- php4/ext/session/mod_mm.c:1.22.2.1 Thu Oct 11 19:52:00 2001
+++ php4/ext/session/mod_mm.c Thu Jan 10 01:15:46 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mod_mm.c,v 1.22.2.1 2001/10/11 23:52:00 ssb Exp $ */
+/* $Id: mod_mm.c,v 1.22.2.2 2002/01/10 06:15:46 yohgaki Exp $ */
#include "php.h"
@@ -35,7 +35,7 @@
# error mm is not thread-safe
#endif
-#define PS_MM_PATH "/tmp/session_mm"
+#define PS_MM_FILE "session_mm"
/* For php_uint32 */
#include "ext/standard/basic_functions.h"
@@ -247,8 +247,18 @@
PHP_MINIT_FUNCTION(ps_mm)
{
+ char *ps_mm_path = calloc(strlen(PS(save_path))+1+strlen(PS_MM_FILE)+1, 1); /* Directory +
'/' + File + \0 */
+
ps_mm_instance = calloc(sizeof(*ps_mm_instance), 1);
- if (ps_mm_initialize(ps_mm_instance, PS_MM_PATH) != SUCCESS) {
+
+ strcpy(ps_mm_path, PS(save_path));
+
+ if((strlen(ps_mm_path) > 0) && (ps_mm_path[strlen(ps_mm_path)-1] != '/'))
+ strcat(ps_mm_path, "/"); /* Fixme Windows */
+
+ strcat(ps_mm_path, PS_MM_FILE);
+
+ if (ps_mm_initialize(ps_mm_instance, ps_mm_path) != SUCCESS) {
ps_mm_instance = NULL;
return FAILURE;
}