Weep out all recent commits of Yasuo.

I don't have time right now to leave in the good ones and remove
only the bad ones.

There are some semantical changes which I reject, because
they aim at fixing a bug which is at a completely other location.

Then SID does not gefined anymore properly. (This broken patch
has not been sent to me at all.)

Also, there were *so* many whitespace changes which already
make these commits bogus.
This commit is contained in:
Sascha Schumann 2002-03-06 09:02:31 +00:00
parent d36ddb5a9f
commit ca59cb7cf9
5 changed files with 109 additions and 184 deletions

View file

@ -123,9 +123,10 @@ static void ps_files_close(ps_files *data)
}
}
static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
static void ps_files_open(ps_files *data, const char *key)
{
char buf[MAXPATHLEN];
TSRMLS_FETCH();
if (data->fd < 0 || !data->lastkey || strcmp(key, data->lastkey)) {
if (data->lastkey) {
@ -136,10 +137,8 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
ps_files_close(data);
if (!ps_files_valid_key(key) ||
!ps_files_path_create(buf, sizeof(buf), data, key)) {
data->fd = -1;
!ps_files_path_create(buf, sizeof(buf), data, key))
return;
}
data->lastkey = estrdup(key);
@ -160,7 +159,7 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
}
}
static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
static int ps_files_cleanup_dir(const char *dirname, int maxlifetime)
{
DIR *dir;
char dentry[sizeof(struct dirent) + MAXPATHLEN];
@ -170,6 +169,7 @@ static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
time_t now;
int nrdels = 0;
size_t dirname_len;
TSRMLS_FETCH();
dir = opendir(dirname);
if (!dir) {
@ -254,7 +254,7 @@ PS_READ_FUNC(files)
struct stat sbuf;
PS_FILES_DATA;
ps_files_open(data, key TSRMLS_CC);
ps_files_open(data, key);
if (data->fd < 0)
return FAILURE;
@ -283,7 +283,7 @@ PS_WRITE_FUNC(files)
long n;
PS_FILES_DATA;
ps_files_open(data, key TSRMLS_CC);
ps_files_open(data, key);
if (data->fd < 0)
return FAILURE;
@ -314,6 +314,7 @@ PS_DESTROY_FUNC(files)
{
char buf[MAXPATHLEN];
PS_FILES_DATA;
TSRMLS_FETCH();
if (!ps_files_path_create(buf, sizeof(buf), data, key))
return FAILURE;
@ -336,7 +337,7 @@ PS_GC_FUNC(files)
an external entity (i.e. find -ctime x | xargs rm) */
if (data->dirdepth == 0)
*nrdels = ps_files_cleanup_dir(data->basedir, maxlifetime TSRMLS_CC);
*nrdels = ps_files_cleanup_dir(data->basedir, maxlifetime);
return SUCCESS;
}