summaryrefslogtreecommitdiff
path: root/ext/session/mod_mm.c
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2002-01-10 06:14:40 +0000
committerYasuo Ohgaki <yohgaki@php.net>2002-01-10 06:14:40 +0000
commit5c0dfdbdbe2161a703b5d95d64c98f65cb1b041a (patch)
tree17842569f9676c8ab1644c79fa15e2370082ae62 /ext/session/mod_mm.c
parent3a86163f19c3f20711423f61cb3558d541171ce8 (diff)
downloadphp-git-5c0dfdbdbe2161a703b5d95d64c98f65cb1b041a.tar.gz
Make use of save_path for mm file.
Patch by Henning Schmiedehausen <hps@intermeta.de> Closes bug 14808
Diffstat (limited to 'ext/session/mod_mm.c')
-rw-r--r--ext/session/mod_mm.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c
index d6f217d9eb..0cd684cf61 100644
--- a/ext/session/mod_mm.c
+++ b/ext/session/mod_mm.c
@@ -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 @@ static void ps_mm_destroy(ps_mm *data)
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;
}