php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9933 readdir doesn't work see Bug ID # 9058
Submitted: 2001-03-22 11:59 UTC Modified: 2001-04-29 06:17 UTC
From: Larry dot Schartman at uc dot edu Assigned:
Status: Closed Package: Directory function related
PHP Version: 4.0.4pl1 OS: HP-UX 10.20
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Larry dot Schartman at uc dot edu
New email:
PHP Version: OS:

 

 [2001-03-22 11:59 UTC] Larry dot Schartman at uc dot edu
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-27 02:23 UTC] Larry dot Schartman at uc dot edu
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


 [2001-04-29 06:17 UTC] jmoore@php.net
This should be fixed in CVS please reopen if the problem persists

- james
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Nov 24 07:01:24 2020 UTC