[packages/php/PHP_7_0] fix readdir_r signature detection
atler
atler at pld-linux.org
Sat Jan 25 15:05:09 CET 2025
commit f3c6e309c5dd88df8ef086f2948e4838e07516ca
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 065d51b..36a0693 100644
--- a/php.spec
+++ b/php.spec
@@ -223,6 +223,7 @@ Patch77: icu70.patch
Patch78: libxml2-2.12.patch
Patch79: types.patch
Patch80: includes.patch
+Patch81: 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}
@@ -2039,6 +2040,7 @@ cp -p php.ini-production php.ini
%patch -P78 -p1
%patch -P79 -p1
%patch -P80 -p1
+%patch -P81 -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..0d7d81c
--- /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/08c47c435bbc377aa1f55ad3740ea1393df474b4
More information about the pld-cvs-commit
mailing list