]> granicus.if.org Git - php/commitdiff
#ifdef out the rest of that getpwuid_r() patch, see prior commit
authorSara Golemon <pollita@php.net>
Thu, 11 Jan 2007 02:31:50 +0000 (02:31 +0000)
committerSara Golemon <pollita@php.net>
Thu, 11 Jan 2007 02:31:50 +0000 (02:31 +0000)
ext/posix/posix.c

index 3b8ab338c9f29b610db559a498e5d8efcf3bbd8a..cff3cdab255593f0f73f353473c813ba55cf4011 100644 (file)
@@ -932,7 +932,7 @@ PHP_FUNCTION(posix_getpwnam)
        struct passwd *pw;
        char *name;
        int name_len;
-#ifdef HAVE_GETPWNAM_R
+#if defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)
        struct passwd pwbuf;
        int buflen;
        char *buf;
@@ -965,7 +965,7 @@ PHP_FUNCTION(posix_getpwnam)
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix passwd struct to array");
                RETVAL_FALSE;
        }
-#ifdef HAVE_GETPWNAM_R
+#if defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWNAM_R)
        efree(buf);
 #endif
 }
@@ -976,7 +976,7 @@ PHP_FUNCTION(posix_getpwnam)
 PHP_FUNCTION(posix_getpwuid)
 {
        long uid;
-#ifdef HAVE_GETPWUID_R
+#if defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)
        struct passwd _pw;
        struct passwd *retpwptr = NULL;
        int pwbuflen;
@@ -1012,7 +1012,7 @@ PHP_FUNCTION(posix_getpwuid)
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix passwd struct to array");
                RETVAL_FALSE;
        }
-#ifdef HAVE_GETPWUID_R
+#if defined(_SC_GETPW_R_SIZE_MAX) && defined(HAVE_GETPWUID_R)
        efree(pwbuf);
 #endif
 }