Re: [PHP-DEV] PHP 4.0 Bug #9933 Updated: readdir doesn't work see Bug ID # 9058

2001-04-27 Thread Andi Gutmans

At 12:34 PM 4/27/2001 +0200, Sascha Schumann wrote:
On Fri, 27 Apr 2001, Andi Gutmans wrote:

  Larry,
  You are right if this code refers to the POSIX semantics of readdir_r.
  However, this code is in #if defined(HAVE_OLD_READDIR_R) and I don't know
  what is meant by old readdir_r (different semantics?).
  Sascha? Can you shed some light on this?

 It is a non-standard readdir_r commonly found on SysV
 platforms and derivatives.

So what does that mean? The code is OK there and it isn't reached on 
systems where readdir_r returns 0 for success? I'm not quite sure what to 
do with this bug report.

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] PHP 4.0 Bug #9933 Updated: readdir doesn't work see Bug ID # 9058

2001-04-27 Thread Sascha Schumann

 So what does that mean? The code is OK there and it isn't reached on
 systems where readdir_r returns 0 for success? I'm not quite sure what to
 do with this bug report.

We either need to differentiate between Solaris and HPUX
readdir_r or ignore the return value of that system call, as
the semantics differ.  Solaris return non-zero on success
whereas HPUX returns zero.

This could be achieved by setting entry-d_name[0] to NUL
before the system call and assume that it failed, if the
system call does not change the contents of d_name.

- Sascha Experience IRCG
  http://schumann.cx/http://schumann.cx/ircg


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] PHP 4.0 Bug #9933 Updated: readdir doesn't work see Bug ID # 9058

2001-04-27 Thread Andi Gutmans

Larry,
You are right if this code refers to the POSIX semantics of readdir_r.
However, this code is in #if defined(HAVE_OLD_READDIR_R) and I don't know 
what is meant by old readdir_r (different semantics?).
Sascha? Can you shed some light on this?

Andi

At 06:23 AM 4/27/2001 +, [EMAIL PROTECTED] wrote:
ID: 9933
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: Directory function related
Description: readdir doesn't work  see Bug ID # 9058

Hi,

i think this is the problem (reentrancy.c)
 int ret;

 errno = 0;

 ret = readdir_r(dirp, entry);

 if (!ret || errno != 0) {
 

 *result = NULL;
 } else {
 *result = entry;
 }

 return errno;

thr return value of readdir_r is 0 on success, so the above
will return NULL on success. The line should be something like

if (ret != 0 || errno != 0) {


Thomas



Previous Comments:
---

[2001-03-22 11:59:49] [EMAIL PROTECTED]
Greetings,

I have unknowlingly followed the same path that Brian has in bug report # 
9058.  Namely, HP-UX 10.20, gcc version 2.95, PHP compiled many different 
ways but latley  -
./configure --enable-libgcc --with-apxs=/usr/local/apache/bin/apxs
  --with-mysql=/usr/local/mysql --disable-posix
My application seems to work OK with the execption of no files listed from 
a readdir call.  The example code from readdir returns -
Directory handle: Resource id #1 Files:
and no file names.

Please let me know if there is anything I can do.

larry


---


Full Bug description available at: http://bugs.php.net/?id=9933


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]