summaryrefslogtreecommitdiff
path: root/ext/session
diff options
context:
space:
mode:
authorAnantha Kesari H Y <hyanantha@php.net>2004-09-30 14:23:51 +0000
committerAnantha Kesari H Y <hyanantha@php.net>2004-09-30 14:23:51 +0000
commitccbeace1ffb09e62ab020fccca41dd72000c657b (patch)
tree483a251c044a7763ae8ab4810e4f5f6506f48118 /ext/session
parent0ea23249da638440da15ecf7274efed12be3e3e3 (diff)
downloadphp-git-ccbeace1ffb09e62ab020fccca41dd72000c657b.tar.gz
handled NetWare F_SETFD and stat differences
Diffstat (limited to 'ext/session')
-rw-r--r--ext/session/mod_files.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index adcb476f6e..75ccaaf97d 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -166,7 +166,12 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
flock(data->fd, LOCK_EX);
#ifdef F_SETFD
+#ifdef NETWARE
+ /* NetWare LibC returns -1 upon error and upon success it returns non-zero unlike zero in other OSes*/
+ if (fcntl(data->fd, F_SETFD, 1) == -1) {
+#else
if (fcntl(data->fd, F_SETFD, 1)) {
+#endif
php_error_docref(NULL TSRMLS_CC, E_WARNING, "fcntl(%d, F_SETFD, 1) failed: %s (%d)", data->fd, strerror(errno), errno);
}
#endif
@@ -216,7 +221,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 &&
+#ifdef NETWARE
+ (now - sbuf.st_mtime.tv_sec) > maxlifetime) {
+#else
(now - sbuf.st_mtime) > maxlifetime) {
+#endif
VCWD_UNLINK(buf);
nrdels++;
}