com php-src: reapply the sysconf error check patch: ext/standard/exec.c
| From: | Anatol Belski | Date: | Tue, 02 Feb 2016 14:17:09 +0000 |
| Subject: | com php-src: reapply the sysconf error check patch: ext/standard/exec.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-90907@lists.php.net to get a copy of this message | ||
Commit: 4e1b8701573698f56e12672e4991d7e6239138d2
Author: Anatol Belski <ab@php.net> Tue, 2 Feb 2016 14:26:58 +0100
Parents: 6a4825675233deeb57955e31a819c5e56b4e7335
Branches: PHP-7.0.3
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4e1b8701573698f56e12672e4991d7e6239138d2
Log:
reapply the sysconf error check patch
Changed paths:
M ext/standard/exec.c
Diff:
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index cbaaedb..a73d0b4 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -50,6 +50,10 @@
#include <unistd.h>
#endif
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
static int cmd_max_len;
/* {{{ PHP_MINIT_FUNCTION(exec) */
@@ -57,6 +61,13 @@ PHP_MINIT_FUNCTION(exec)
{
#ifdef _SC_ARG_MAX
cmd_max_len = sysconf(_SC_ARG_MAX);
+ if (-1 == cmd_max_len) {
+#ifdef _POSIX_ARG_MAX
+ cmd_max_len = _POSIX_ARG_MAX;
+#else
+ cmd_max_len = 4096;
+#endif
+ }
#elif defined(ARG_MAX)
cmd_max_len = ARG_MAX;
#elif defined(PHP_WIN32)