Fixed crash (bus error) in readdir() and session cleanup when compiled

with Sun CC.
This commit is contained in:
foobar 2000-10-18 14:14:14 +00:00
parent 33d15279ac
commit 7a54e0b10c
2 changed files with 2 additions and 2 deletions

View file

@ -156,7 +156,7 @@ static void ps_files_open(ps_files *data, const char *key)
static int ps_files_cleanup_dir(const char *dirname, int maxlifetime)
{
DIR *dir;
char dentry[sizeof(struct dirent) + MAXPATHLEN + 1];
char dentry[sizeof(struct dirent) + MAXPATHLEN];
struct dirent *entry = (struct dirent *) &dentry;
struct stat sbuf;
char buf[MAXPATHLEN];

View file

@ -289,7 +289,7 @@ PHP_FUNCTION(readdir)
{
pval **id, **tmp, *myself;
php_dir *dirp;
char entry[sizeof(struct dirent)+MAXPATHLEN+1];
char entry[sizeof(struct dirent)+MAXPATHLEN];
struct dirent *result = (struct dirent *)&entry; /* patch for libc5 readdir problems */
DIRLS_FETCH();