]> granicus.if.org Git - php/commitdiff
fix #40410 (ext/posix does not compile on MacOS 10.3.9)
authorAntony Dovgal <tony2001@php.net>
Fri, 9 Feb 2007 10:15:03 +0000 (10:15 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 9 Feb 2007 10:15:03 +0000 (10:15 +0000)
ext/posix/posix.c

index bf46c0cdb6f22dc1e2845a50c3909ed28579d8fd..7645a3d89f00e331ab40d358c812774d527da21e 100644 (file)
@@ -882,7 +882,7 @@ PHP_FUNCTION(posix_getgrgid)
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &gid) == FAILURE) {
                RETURN_FALSE;
        }
-#ifdef HAVE_GETGRGID_R
+#if defined(ZTS) && defined(HAVE_GETGRGID_R) && defined(_SC_GETGR_R_SIZE_MAX)
        
        grbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
        grbuf = emalloc(grbuflen);
@@ -907,7 +907,7 @@ PHP_FUNCTION(posix_getgrgid)
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix group struct to array");
                RETVAL_FALSE;
        }
-#ifdef HAVE_GETGRGID_R
+#if defined(ZTS) && defined(HAVE_GETGRGID_R) && defined(_SC_GETGR_R_SIZE_MAX)
        efree(grbuf);
 #endif
 }