PHP 4.0 Bug #7534: configure test for POSIX readdir_r dumps core
| From: | mills at cc dot umanitoba dot ca | Date: | Mon, 30 Oct 2000 17:12:30 +0000 |
| Subject: | PHP 4.0 Bug #7534: configure test for POSIX readdir_r dumps core | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-36461@lists.php.net to get a copy of this message | ||
From: mills@cc.umanitoba.ca
Operating system: Solaris 2.6
PHP version: 4.0.3pl1
PHP Bug Type: *Install and Config
Bug description: configure test for POSIX readdir_r dumps core
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)
--
Edit Bug report at: http://bugs.php.net/?id=7534&edit=1