[PHP-DEV] PHP 4.0 Bug #7534 Updated: configure test for POSIX readdir_r dumps core From: sniper <email protected>
Date: 10/30/00

ID: 7534
Updated by: sniper
Reported By: mills <email protected>
Status: Closed
Bug Type: *Install and Config
Assigned To:
Comments:

This is fixed in CVS. Please grab a snapshot from http://snaps.php.net/
and reopen this bug report if problem still exists with it.

--Jani

Previous Comments:
---------------------------------------------------------------------------

[2000-10-30 12:12:30] mills <email protected>
make fails with the following error:

"reentrancy.c", line 106: prototype mismatch: 2 args passed, 3 expected
cc: acomp failed for reentrancy.c
*** Error code 1

The bug is in the test program in the configure script.
Because the `entry' array is not initialized to zeroes
the readdir_r call causes a core dump. A quick fix is
to make it a global variable. Here's a patch:

*** Oconfigure Sun Oct 15 06:47:10 2000
--- configure Sun Oct 29 12:23:04 2000
***************
*** 6879,6888 ****
  #include <sys/types.h>
  #include <dirent.h>
  
  main() {
        DIR *dir;
! char entry[sizeof(struct dirent)+257];
! struct dirent *pentry = (struct dirent *) &entry;
  
        dir = opendir("/");
        if (!dir)
--- 6879,6888 ----
  #include <sys/types.h>
  #include <dirent.h>
  
+ char entry[sizeof(struct dirent)+257];
  main() {
        DIR *dir;
! struct dirent *pentry;
  
        dir = opendir("/");
        if (!dir)

---------------------------------------------------------------------------

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

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>