summaryrefslogtreecommitdiff
path: root/ext/session/mod_files.c
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2002-02-03 05:40:19 +0000
committerYasuo Ohgaki <yohgaki@php.net>2002-02-03 05:40:19 +0000
commitbd32363e2f632a44d2a2e0e8f326c4cb6cfaee89 (patch)
treedbcb386a3ff638e12a87576d8792951d6c93465c /ext/session/mod_files.c
parent4c6e58ac597be7565bd8715520e28a35f9dd2931 (diff)
downloadphp-git-bd32363e2f632a44d2a2e0e8f326c4cb6cfaee89.tar.gz
Revert last commit. Last patch has problem for the 1st request.
# I also found what's wrong in mod_mm.c :) # I'll fix it later since don't have much time now.
Diffstat (limited to 'ext/session/mod_files.c')
-rw-r--r--ext/session/mod_files.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index ce6365365e..96f0c3a93e 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -123,7 +123,7 @@ static void ps_files_close(ps_files *data)
}
}
-static int ps_files_open(ps_files *data, const char *key)
+static void ps_files_open(ps_files *data, const char *key)
{
char buf[MAXPATHLEN];
TSRMLS_FETCH();
@@ -138,7 +138,7 @@ static int ps_files_open(ps_files *data, const char *key)
if (!ps_files_valid_key(key) ||
!ps_files_path_create(buf, sizeof(buf), data, key))
- return FAILURE;
+ return;
data->lastkey = estrdup(key);
@@ -153,13 +153,10 @@ static int ps_files_open(ps_files *data, const char *key)
if (data->fd != -1)
flock(data->fd, LOCK_EX);
- if (data->fd == -1) {
+ if (data->fd == -1)
php_error(E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf,
strerror(errno), errno);
- return FAILURE;
- }
}
- return SUCCESS;
}
static int ps_files_cleanup_dir(const char *dirname, int maxlifetime)
@@ -257,9 +254,7 @@ PS_READ_FUNC(files)
struct stat sbuf;
PS_FILES_DATA;
- if (ps_files_open(data, key) == FAILURE)
- return FAILURE;
-
+ ps_files_open(data, key);
if (data->fd < 0)
return FAILURE;
@@ -288,9 +283,7 @@ PS_WRITE_FUNC(files)
long n;
PS_FILES_DATA;
- if (ps_files_open(data, key) == FAILURE)
- return FAILURE;
-
+ ps_files_open(data, key);
if (data->fd < 0)
return FAILURE;