summaryrefslogtreecommitdiff
path: root/ext/session
diff options
context:
space:
mode:
authorAnantha Kesari H Y <hyanantha@php.net>2003-01-03 14:24:07 +0000
committerAnantha Kesari H Y <hyanantha@php.net>2003-01-03 14:24:07 +0000
commit90ba72407243eac16eb89d65cb97307599e1840c (patch)
tree4938b5c4b1c4b437b2aae4f1110f2af4dabf5d4b /ext/session
parent3e2f1526bc4eb3a6c63969064bf37db85220d80a (diff)
downloadphp-git-90ba72407243eac16eb89d65cb97307599e1840c.tar.gz
Modified for NetWare.
Diffstat (limited to 'ext/session')
-rw-r--r--ext/session/mod_files.c12
-rw-r--r--ext/session/session.c8
2 files changed, 20 insertions, 0 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index 684b42c793..af6c1dbf1d 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -172,7 +172,11 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
DIR *dir;
char dentry[sizeof(struct dirent) + MAXPATHLEN];
struct dirent *entry = (struct dirent *) &dentry;
+#if defined(NETWARE) && defined(CLIB_STAT_PATCH)
+ struct stat_libc sbuf;
+#else
struct stat sbuf;
+#endif
char buf[MAXPATHLEN];
time_t now;
int nrdels = 0;
@@ -206,7 +210,11 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
buf[dirname_len + entry_len + 1] = '\0';
/* check whether its last access was more than maxlifet ago */
if (VCWD_STAT(buf, &sbuf) == 0 &&
+#if defined(NETWARE) && defined(CLIB_STAT_PATCH)
+ (now - (sbuf.st_mtime).tv_sec) > maxlifetime) {
+#else
(now - sbuf.st_mtime) > maxlifetime) {
+#endif
VCWD_UNLINK(buf);
nrdels++;
}
@@ -258,7 +266,11 @@ PS_CLOSE_FUNC(files)
PS_READ_FUNC(files)
{
long n;
+#if defined(NETWARE) && defined(CLIB_STAT_PATCH)
+ struct stat_libc sbuf;
+#else
struct stat sbuf;
+#endif
PS_FILES_DATA;
ps_files_open(data, key TSRMLS_CC);
diff --git a/ext/session/session.c b/ext/session/session.c
index a720cf004a..1392d309d1 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -729,7 +729,11 @@ static void strcpy_gmt(char *ubuf, time_t *when)
static void last_modified(TSRMLS_D)
{
const char *path;
+#if defined(NETWARE) && defined(CLIB_STAT_PATCH)
+ struct stat_libc sb;
+#else
struct stat sb;
+#endif
char buf[MAX_STR + 1];
path = SG(request_info).path_translated;
@@ -740,7 +744,11 @@ static void last_modified(TSRMLS_D)
#define LAST_MODIFIED "Last-Modified: "
memcpy(buf, LAST_MODIFIED, sizeof(LAST_MODIFIED) - 1);
+#ifdef NETWARE
+ strcpy_gmt(buf + sizeof(LAST_MODIFIED) - 1, &((sb.st_mtime).tv_sec));
+#else
strcpy_gmt(buf + sizeof(LAST_MODIFIED) - 1, &sb.st_mtime);
+#endif
ADD_COOKIE(buf);
}
}