diff options
| author | Zeev Suraski <zeev@php.net> | 1999-06-06 19:53:59 +0000 |
|---|---|---|
| committer | Zeev Suraski <zeev@php.net> | 1999-06-06 19:53:59 +0000 |
| commit | 34b3dc9b470946bc35d8a33e49a6d8d8ab74c3f1 (patch) | |
| tree | b7690d1e59126829ac9f407675f537f2bf7aee93 /ext/session/mod_files.c | |
| parent | 82806ea2544efef60be82bbe6051d35b932bed34 (diff) | |
| download | php-git-34b3dc9b470946bc35d8a33e49a6d8d8ab74c3f1.tar.gz | |
- Fix PSLS issues
- Add a standard info function for the session module (use them!)
- Replace PATH_MAX with MAXPATHLEN (that's our platform indepedent constant)
Diffstat (limited to 'ext/session/mod_files.c')
| -rw-r--r-- | ext/session/mod_files.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 9ec9ef6998..6d998827c1 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -42,10 +42,12 @@ typedef struct { char *basedir; } ps_files; + ps_module ps_mod_files = { PS_MOD(files) }; + #define PS_FILES_DATA ps_files *data = *mod_data PS_OPEN_FUNC(files) @@ -76,7 +78,7 @@ PS_CLOSE_FUNC(files) static void _ps_files_open(ps_files *data, const char *key) { - char buf[PATH_MAX]; + char buf[MAXPATHLEN]; if(data->fd < 0 || !data->lastkey || strcmp(key, data->lastkey)) { if(data->lastkey) efree(data->lastkey); @@ -84,7 +86,7 @@ static void _ps_files_open(ps_files *data, const char *key) data->lastkey = estrdup(key); - snprintf(buf, PATH_MAX, "%s/%s", data->basedir, key); + snprintf(buf, MAXPATHLEN, "%s/%s", data->basedir, key); data->fd = open(buf, O_CREAT | O_RDWR, 0600); if(data->fd > -1) { flock(data->fd, LOCK_EX); @@ -137,10 +139,10 @@ PS_WRITE_FUNC(files) PS_DELETE_FUNC(files) { - char buf[PATH_MAX]; + char buf[MAXPATHLEN]; PS_FILES_DATA; - snprintf(buf, PATH_MAX, "%s/%s", data->basedir, key); + snprintf(buf, MAXPATHLEN, "%s/%s", data->basedir, key); unlink(buf); return SUCCESS; |
