[packages/php/PHP_7_2] fix readdir_r signature detection

atler atler at pld-linux.org
Fri Jan 24 21:17:15 CET 2025


commit 978b04164a1fa75160368310af6981bd25fa63cc
Author: Jan Palus <atler at pld-linux.org>
Date:   Thu Jan 23 12:55:49 2025 +0100

    fix readdir_r signature detection

 php.spec        |  2 ++
 readdir_r.patch | 30 ++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)
---
diff --git a/php.spec b/php.spec
index 20b6a73..123ab94 100644
--- a/php.spec
+++ b/php.spec
@@ -228,6 +228,7 @@ Patch76:	missing-includes.patch
 Patch77:	libxml2-2.12.patch
 Patch78:	types.patch
 Patch79:	includes.patch
+Patch80:	readdir_r.patch
 URL:		https://www.php.net/
 %{?with_interbase:%{!?with_interbase_inst:BuildRequires:	Firebird-devel >= 1.0.2.908-2}}
 %{?with_pspell:BuildRequires:	aspell-devel >= 2:0.50.0}
@@ -2061,6 +2062,7 @@ cp -p php.ini-production php.ini
 %patch -P77 -p1
 %patch -P78 -p1
 %patch -P79 -p1
+%patch -P80 -p1
 
 sed -E -i -e '1s,#!\s*/usr/bin/env\s+(.*),#!%{__bindir}\1,' \
       run-tests.php
diff --git a/readdir_r.patch b/readdir_r.patch
new file mode 100644
index 0000000..7164ffc
--- /dev/null
+++ b/readdir_r.patch
@@ -0,0 +1,30 @@
+--- php-7.2.34/acinclude.m4.orig	2025-01-23 20:45:18.432571977 +0100
++++ php-7.2.34/acinclude.m4	2025-01-23 20:54:20.252520613 +0100
+@@ -1349,12 +1349,13 @@
+ #define _REENTRANT
+ #include <sys/types.h>
+ #include <dirent.h>
++#include <stdlib.h>
+ 
+ #ifndef PATH_MAX
+ #define PATH_MAX 1024
+ #endif
+ 
+-main() {
++int main() {
+   DIR *dir;
+   char entry[sizeof(struct dirent)+PATH_MAX];
+   struct dirent *pentry = (struct dirent *) &entry;
+@@ -1363,10 +1364,10 @@
+   if (!dir)
+     exit(1);
+   if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0) {
+-    close(dir);
++    closedir(dir);
+     exit(0);
+   }
+-  close(dir);
++  closedir(dir);
+   exit(1);
+ }
+     ],[
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/ea527344ad1d621544ff9b4c1e42ef1383ce56f2



More information about the pld-cvs-commit mailing list