From faf4f764b72ba3b71fef601c70ee3de6165f693f Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Wed, 24 May 2000 14:41:28 +0000 Subject: [PATCH] If no further directory exists, php_readdir_r() returns success and sets *result to NULL. --- main/reentrancy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/reentrancy.c b/main/reentrancy.c index c180a5af2b6..4677d52ea20 100644 --- a/main/reentrancy.c +++ b/main/reentrancy.c @@ -108,8 +108,10 @@ PHPAPI int php_readdir_r(DIR *dirp, struct dirent *entry, if (ret == 0) *result = entry; - else + else if (errno == 0) { *result = NULL; + ret = 0; + } return ret; #else