[packages/php/PHP_7_1] fix readdir_r signature detection
atler
atler at pld-linux.org
Sat Jan 25 03:37:06 CET 2025
commit 3a75bc7f0243b013ec5764da9dc75c547215e30b
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 a65df91..f57d048 100644
--- a/php.spec
+++ b/php.spec
@@ -222,6 +222,7 @@ Patch75: icu70.patch
Patch76: libxml2-2.12.patch
Patch77: types.patch
Patch78: includes.patch
+Patch79: 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}
@@ -2051,6 +2052,7 @@ cp -p php.ini-production php.ini
%patch -P76 -p1
%patch -P77 -p1
%patch -P78 -p1
+%patch -P79 -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/6f09f2e918484e21decfe1c8583f5a0ffab40951
More information about the pld-cvs-commit
mailing list