From fe49acfcb9f203b67561a9b6ff71b0c05a2b1a9f Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Sat, 20 Sep 2008 22:12:59 +0000 Subject: [PATCH] MFH: Fixed #46059 (Compile failure under IRIX 6.5.30 building posix.c) --- NEWS | 4 +++- ext/posix/config.m4 | 16 ++++++++++++++++ ext/posix/posix.c | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 6ad6c075d3..98aaf6d3a1 100644 --- a/NEWS +++ b/NEWS @@ -18,7 +18,9 @@ PHP NEWS (Scott) - Fixed a crash on invalid method in ReflectionParameter constructor. (Christian Seiler) -- Fixed buf #46053 (SplFileObject::seek - Endless loop). (Arnaud) +- Fixed bug #46059 (Compile failure under IRIX 6.5.30 building posix.c). + (Arnaud) +- Fixed bug #46053 (SplFileObject::seek - Endless loop). (Arnaud) - Fixed bug #46051 (SplFileInfo::openFile - memory overlap). (Arnaud) - Fixed bug #46047 (SimpleXML converts empty nodes into object with nested array). (Rob) diff --git a/ext/posix/config.m4 b/ext/posix/config.m4 index f88e2615ff..ada08ce946 100644 --- a/ext/posix/config.m4 +++ b/ext/posix/config.m4 @@ -31,4 +31,20 @@ int main(int argc, char *argv[]) ], [ AC_MSG_RESULT([no, cannot detect working ttyname_r() when cross compiling. posix_ttyname() will be thread-unsafe]) ]) + + AC_CACHE_CHECK([for utsname.domainname], ac_cv_have_utsname_domainname, [ + AC_TRY_COMPILE([ + #define _GNU_SOURCE + #include + ],[ + return sizeof(((struct utsname *)0)->domainname); + ],[ + ac_cv_have_utsname_domainname=yes + ],[ + ac_cv_have_utsname_domainname=no + ]) + ]) + if test ac_cv_have_utsname_domainname=yes; then + AC_DEFINE(HAVE_UTSNAME_DOMAINNAME, 1, [Wether struct utsname has domainname]) + fi fi diff --git a/ext/posix/posix.c b/ext/posix/posix.c index 2ade7d7682..5be6420b4d 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -467,7 +467,7 @@ PHP_FUNCTION(posix_uname) add_assoc_string(return_value, "release", u.release, 1); add_assoc_string(return_value, "version", u.version, 1); add_assoc_string(return_value, "machine", u.machine, 1); -#if defined(_GNU_SOURCE) && !defined(DARWIN) +#if defined(_GNU_SOURCE) && !defined(DARWIN) && defined(HAVE_UTSNAME_DOMAINNAME) add_assoc_string(return_value, "domainname", u.domainname, 1); #endif } -- 2.50.1