-diff -Nru php-5.2.8.vanilla/configure php-5.2.8.fpm/configure
-diff -Nru php-5.2.8.vanilla/configure.in php-5.2.8.fpm/configure.in
---- php-5.2.8.vanilla/configure.in 2008-12-07 22:23:25.000000000 +0300
-+++ php-5.2.8.fpm/configure.in 2008-12-09 04:00:14.000000000 +0300
-@@ -297,6 +297,12 @@
+diff --git a/configure b/configure
+index 2d88ed7..c490abf 100755
+diff --git a/configure.in b/configure.in
+index e181ac9..4424930 100644
+--- a/configure.in
++++ b/configure.in
+@@ -295,6 +295,12 @@ if test "$enable_maintainer_zts" = "yes"; then
PTHREADS_FLAGS
fi
divert(3)
dnl ## In diversion 3 we check for compile-time options to the PHP
-@@ -514,6 +520,7 @@
+@@ -511,6 +517,7 @@ AC_CHECK_FUNCS(
alphasort \
asctime_r \
chroot \
ctime_r \
cuserid \
crypt \
-@@ -1239,6 +1246,8 @@
+@@ -1253,6 +1260,8 @@ PHP_SUBST_OLD(EXTENSION_DIR)
PHP_SUBST_OLD(EXTRA_LDFLAGS)
PHP_SUBST_OLD(EXTRA_LDFLAGS_PROGRAM)
PHP_SUBST_OLD(EXTRA_LIBS)
PHP_SUBST_OLD(ZEND_EXTRA_LIBS)
PHP_SUBST_OLD(INCLUDES)
PHP_SUBST_OLD(EXTRA_INCLUDES)
-@@ -1351,7 +1360,7 @@
+@@ -1364,7 +1373,7 @@ case $PHP_SAPI in
install_targets="$PHP_INSTALL_CLI_TARGET $install_targets"
;;
*)
;;
esac
-diff -Nru php-5.2.8.vanilla/libevent/aclocal.m4 php-5.2.8.fpm/libevent/aclocal.m4
-diff -Nru php-5.2.8.vanilla/libevent/autogen.sh php-5.2.8.fpm/libevent/autogen.sh
-diff -Nru php-5.2.8.vanilla/libevent/buffer.c php-5.2.8.fpm/libevent/buffer.c
-diff -Nru php-5.2.8.vanilla/libevent/ChangeLog php-5.2.8.fpm/libevent/ChangeLog
-diff -Nru php-5.2.8.vanilla/libevent/compat/sys/queue.h php-5.2.8.fpm/libevent/compat/sys/queue.h
-diff -Nru php-5.2.8.vanilla/libevent/compat/sys/_time.h php-5.2.8.fpm/libevent/compat/sys/_time.h
-diff -Nru php-5.2.8.vanilla/libevent/config.h.in php-5.2.8.fpm/libevent/config.h.in
-diff -Nru php-5.2.8.vanilla/libevent/configure php-5.2.8.fpm/libevent/configure
-diff -Nru php-5.2.8.vanilla/libevent/configure.in php-5.2.8.fpm/libevent/configure.in
-diff -Nru php-5.2.8.vanilla/libevent/depcomp php-5.2.8.fpm/libevent/depcomp
-diff -Nru php-5.2.8.vanilla/libevent/devpoll.c php-5.2.8.fpm/libevent/devpoll.c
-diff -Nru php-5.2.8.vanilla/libevent/epoll.c php-5.2.8.fpm/libevent/epoll.c
-diff -Nru php-5.2.8.vanilla/libevent/epoll_sub.c php-5.2.8.fpm/libevent/epoll_sub.c
-diff -Nru php-5.2.8.vanilla/libevent/evbuffer.c php-5.2.8.fpm/libevent/evbuffer.c
-diff -Nru php-5.2.8.vanilla/libevent/event.3 php-5.2.8.fpm/libevent/event.3
-diff -Nru php-5.2.8.vanilla/libevent/event.c php-5.2.8.fpm/libevent/event.c
-diff -Nru php-5.2.8.vanilla/libevent/event-config.h php-5.2.8.fpm/libevent/event-config.h
-diff -Nru php-5.2.8.vanilla/libevent/event-fpm.h php-5.2.8.fpm/libevent/event-fpm.h
-diff -Nru php-5.2.8.vanilla/libevent/event.h php-5.2.8.fpm/libevent/event.h
-diff -Nru php-5.2.8.vanilla/libevent/event-internal.h php-5.2.8.fpm/libevent/event-internal.h
-diff -Nru php-5.2.8.vanilla/libevent/evhttp.h php-5.2.8.fpm/libevent/evhttp.h
-diff -Nru php-5.2.8.vanilla/libevent/evport.c php-5.2.8.fpm/libevent/evport.c
-diff -Nru php-5.2.8.vanilla/libevent/evsignal.h php-5.2.8.fpm/libevent/evsignal.h
-diff -Nru php-5.2.8.vanilla/libevent/evutil.c php-5.2.8.fpm/libevent/evutil.c
-diff -Nru php-5.2.8.vanilla/libevent/evutil.h php-5.2.8.fpm/libevent/evutil.h
-diff -Nru php-5.2.8.vanilla/libevent/http.c php-5.2.8.fpm/libevent/http.c
-diff -Nru php-5.2.8.vanilla/libevent/http-internal.h php-5.2.8.fpm/libevent/http-internal.h
-diff -Nru php-5.2.8.vanilla/libevent/install-sh php-5.2.8.fpm/libevent/install-sh
-diff -Nru php-5.2.8.vanilla/libevent/kqueue.c php-5.2.8.fpm/libevent/kqueue.c
-diff -Nru php-5.2.8.vanilla/libevent/log.c php-5.2.8.fpm/libevent/log.c
-diff -Nru php-5.2.8.vanilla/libevent/log.h php-5.2.8.fpm/libevent/log.h
-diff -Nru php-5.2.8.vanilla/libevent/Makefile.am php-5.2.8.fpm/libevent/Makefile.am
-diff -Nru php-5.2.8.vanilla/libevent/Makefile.in php-5.2.8.fpm/libevent/Makefile.in
-diff -Nru php-5.2.8.vanilla/libevent/min_heap.h php-5.2.8.fpm/libevent/min_heap.h
-diff -Nru php-5.2.8.vanilla/libevent/missing php-5.2.8.fpm/libevent/missing
-diff -Nru php-5.2.8.vanilla/libevent/poll.c php-5.2.8.fpm/libevent/poll.c
-diff -Nru php-5.2.8.vanilla/libevent/README php-5.2.8.fpm/libevent/README
-diff -Nru php-5.2.8.vanilla/libevent/select.c php-5.2.8.fpm/libevent/select.c
-diff -Nru php-5.2.8.vanilla/libevent/signal.c php-5.2.8.fpm/libevent/signal.c
-diff -Nru php-5.2.8.vanilla/libevent/strlcpy.c php-5.2.8.fpm/libevent/strlcpy.c
-diff -Nru php-5.2.8.vanilla/libevent/strlcpy-internal.h php-5.2.8.fpm/libevent/strlcpy-internal.h
---- php-5.2.8.vanilla/main/php_config.h.in 2008-12-07 22:31:16.000000000 +0300
-+++ php-5.2.8.fpm/main/php_config.h.in 2008-12-13 07:23:02.000000000 +0300
+diff --git a/libevent/ChangeLog b/libevent/ChangeLog
+new file mode 100644
+index 0000000..c592139
+diff --git a/libevent/Makefile.am b/libevent/Makefile.am
+new file mode 100644
+index 0000000..5ccfd2c
+diff --git a/libevent/Makefile.in b/libevent/Makefile.in
+new file mode 100644
+index 0000000..0600dcc
+diff --git a/libevent/README b/libevent/README
+new file mode 100644
+index 0000000..b065039
+diff --git a/libevent/aclocal.m4 b/libevent/aclocal.m4
+new file mode 100644
+index 0000000..74de4a1
+diff --git a/libevent/autogen.sh b/libevent/autogen.sh
+new file mode 100644
+index 0000000..218dbf4
+diff --git a/libevent/buffer.c b/libevent/buffer.c
+new file mode 100644
+index 0000000..e66080f
+diff --git a/libevent/compat/sys/_time.h b/libevent/compat/sys/_time.h
+new file mode 100644
+index 0000000..8cabb0d
+diff --git a/libevent/compat/sys/queue.h b/libevent/compat/sys/queue.h
+new file mode 100644
+index 0000000..c0956dd
+diff --git a/libevent/config.h.in b/libevent/config.h.in
+new file mode 100644
+index 0000000..d151f87
+diff --git a/libevent/configure b/libevent/configure
+new file mode 100644
+index 0000000..0a74aec
+diff --git a/libevent/configure.in b/libevent/configure.in
+new file mode 100644
+index 0000000..852d3c5
+diff --git a/libevent/depcomp b/libevent/depcomp
+new file mode 100644
+index 0000000..ffcd540
+diff --git a/libevent/devpoll.c b/libevent/devpoll.c
+new file mode 100644
+index 0000000..cbd2730
+diff --git a/libevent/epoll.c b/libevent/epoll.c
+new file mode 100644
+index 0000000..cf3c859
+diff --git a/libevent/epoll_sub.c b/libevent/epoll_sub.c
+new file mode 100644
+index 0000000..431970c
+diff --git a/libevent/evbuffer.c b/libevent/evbuffer.c
+new file mode 100644
+index 0000000..f2179a5
+diff --git a/libevent/event-config.h b/libevent/event-config.h
+new file mode 100644
+index 0000000..0a278b3
+diff --git a/libevent/event-fpm.h b/libevent/event-fpm.h
+new file mode 100644
+index 0000000..8625ca5
+diff --git a/libevent/event-internal.h b/libevent/event-internal.h
+new file mode 100644
+index 0000000..7485f21
+diff --git a/libevent/event.3 b/libevent/event.3
+new file mode 100644
+index 0000000..5b33ec6
+diff --git a/libevent/event.c b/libevent/event.c
+new file mode 100644
+index 0000000..826b7db
+diff --git a/libevent/event.h b/libevent/event.h
+new file mode 100644
+index 0000000..d67ecb5
+diff --git a/libevent/evhttp.h b/libevent/evhttp.h
+new file mode 100644
+index 0000000..0d35f9e
+diff --git a/libevent/evport.c b/libevent/evport.c
+new file mode 100644
+index 0000000..31523b4
+diff --git a/libevent/evsignal.h b/libevent/evsignal.h
+new file mode 100644
+index 0000000..8be9cbd
+diff --git a/libevent/evutil.c b/libevent/evutil.c
+new file mode 100644
+index 0000000..86205b2
+diff --git a/libevent/evutil.h b/libevent/evutil.h
+new file mode 100644
+index 0000000..0a018b8
+diff --git a/libevent/http-internal.h b/libevent/http-internal.h
+new file mode 100644
+index 0000000..bc9a1ed
+diff --git a/libevent/http.c b/libevent/http.c
+new file mode 100644
+index 0000000..1d60fc5
+diff --git a/libevent/install-sh b/libevent/install-sh
+new file mode 100644
+index 0000000..1a83534
+diff --git a/libevent/kqueue.c b/libevent/kqueue.c
+new file mode 100644
+index 0000000..38a1819
+diff --git a/libevent/log.c b/libevent/log.c
+new file mode 100644
+index 0000000..b62a619
+diff --git a/libevent/log.h b/libevent/log.h
+new file mode 100644
+index 0000000..7bc6632
+diff --git a/libevent/min_heap.h b/libevent/min_heap.h
+new file mode 100644
+index 0000000..d47e563
+diff --git a/libevent/missing b/libevent/missing
+new file mode 100644
+index 0000000..09edd88
+diff --git a/libevent/poll.c b/libevent/poll.c
+new file mode 100644
+index 0000000..b67c6ff
+diff --git a/libevent/select.c b/libevent/select.c
+new file mode 100644
+index 0000000..7faafe4
+diff --git a/libevent/signal.c b/libevent/signal.c
+new file mode 100644
+index 0000000..bcaa3f9
+diff --git a/libevent/strlcpy-internal.h b/libevent/strlcpy-internal.h
+new file mode 100644
+index 0000000..22b5f61
+diff --git a/libevent/strlcpy.c b/libevent/strlcpy.c
+new file mode 100644
+index 0000000..a1a413d
+diff --git a/main/php_config.h.in b/main/php_config.h.in
+--- a/main/php_config.h.in
++++ b/main/php_config.h.in
@@ -170,6 +170,9 @@
/* Define if you have the chroot function. */
#undef HAVE_CHROOT
/* Define if you have the crypt function. */
#undef HAVE_CRYPT
-@@ -932,6 +935,9 @@
+@@ -935,6 +938,9 @@
/* */
#undef PHP_FASTCGI
/* */
#undef FORCE_CGI_REDIRECT
-@@ -941,6 +947,27 @@
+@@ -944,6 +950,27 @@
/* */
#undef ENABLE_PATHINFO_CHECK
/* Define if system uses EBCDIC */
#undef CHARSET_EBCDIC
---- php-5.2.8.vanilla/sapi/cgi/cgi_main.c 2008-11-28 14:56:50.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/cgi_main.c 2008-12-09 07:17:03.000000000 +0300
+--- php-5.2.17/sapi/cgi/Makefile.frag~ 2012-02-27 14:44:23.000000000 +0200
++++ php-5.2.17/sapi/cgi/Makefile.frag 2012-02-27 14:46:13.037731342 +0200
+@@ -1,2 +1,2 @@
+-$(SAPI_CGI_PATH): libphp_common.la $(PHP_SAPI_OBJS)
++$(SAPI_CGI_PATH): libphp_common.la $(PHP_SAPI_OBJS) $(SAPI_EXTRA_DEPS)
+ $(BUILD_CGI)
+diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
+--- a/sapi/cgi/cgi_main.c
++++ b/sapi/cgi/cgi_main.c
@@ -55,6 +55,9 @@
#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
#include "zend.h"
#include "zend_extensions.h"
#include "php_ini.h"
-@@ -83,6 +86,11 @@
+@@ -83,6 +86,11 @@ int __riscosify_control = __RISCOSIFY_STRICT_UNIX_SPECS;
#if PHP_FASTCGI
#include "fastcgi.h"
#ifndef PHP_WIN32
/* XXX this will need to change later when threaded fastcgi is
implemented. shane */
-@@ -115,8 +123,12 @@
+@@ -115,8 +123,12 @@ static int parent_waiting = 0;
static pid_t pgroup;
#endif
#define PHP_MODE_STANDARD 1
#define PHP_MODE_HIGHLIGHT 2
#define PHP_MODE_INDENT 3
-@@ -146,6 +158,10 @@
+@@ -146,6 +158,10 @@ static const opt_struct OPTIONS[] = {
{'w', 0, "strip"},
{'?', 0, "usage"},/* help alias (both '?' and 'usage') */
{'v', 0, "version"},
{'z', 1, "zend-extension"},
#if PHP_FASTCGI
{'T', 1, "timing"},
-@@ -170,6 +186,7 @@
+@@ -170,6 +186,7 @@ typedef struct _php_cgi_globals_struct {
zend_bool impersonate;
# endif
#endif
} php_cgi_globals_struct;
#ifdef ZTS
-@@ -471,7 +488,28 @@
+@@ -474,7 +491,28 @@ static int sapi_cgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
#if PHP_FASTCGI
if (fcgi_is_fastcgi()) {
fcgi_request *request = (fcgi_request*) SG(server_context);
+ tmp_read_bytes = read(request_body_fd, buffer + read_bytes, count_bytes - read_bytes);
+ }
} else {
- tmp_read_bytes = read(0, buffer + read_bytes, count_bytes - read_bytes);
+ tmp_read_bytes = read(STDIN_FILENO, buffer + read_bytes, count_bytes - read_bytes);
}
-@@ -783,7 +821,12 @@
+@@ -786,7 +824,12 @@ static void php_cgi_usage(char *argv0)
" -s Display colour syntax highlighted source.\n"
" -v Version number\n"
" -w Display source with stripped comments and whitespace.\n"
#if PHP_FASTCGI
" -T <count> Measure execution time of script repeated <count> times.\n"
#endif
-@@ -1231,6 +1274,7 @@
+@@ -1236,6 +1279,7 @@ PHP_INI_BEGIN()
# ifdef PHP_WIN32
STD_PHP_INI_ENTRY("fastcgi.impersonate", "0", PHP_INI_SYSTEM, OnUpdateBool, impersonate, php_cgi_globals_struct, php_cgi_globals)
# endif
#endif
PHP_INI_END()
-@@ -1253,6 +1297,7 @@
+@@ -1258,6 +1302,7 @@ static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals TSRMLS_
# ifdef PHP_WIN32
php_cgi_globals->impersonate = 0;
# endif
#endif
}
/* }}} */
-@@ -1285,9 +1330,47 @@
+@@ -1290,9 +1335,47 @@ static PHP_MSHUTDOWN_FUNCTION(cgi)
static PHP_MINFO_FUNCTION(cgi)
{
DISPLAY_INI_ENTRIES();
static zend_module_entry cgi_module_entry = {
STANDARD_MODULE_HEADER,
#if PHP_FASTCGI
-@@ -1295,7 +1378,7 @@
+@@ -1300,7 +1383,7 @@ static zend_module_entry cgi_module_entry = {
#else
"cgi",
#endif
PHP_MINIT(cgi),
PHP_MSHUTDOWN(cgi),
NULL,
-@@ -1335,6 +1418,7 @@
+@@ -1340,6 +1423,7 @@ int main(int argc, char *argv[])
char *bindpath = NULL;
int fcgi_fd = 0;
fcgi_request request;
int repeats = 1;
int benchmark = 0;
#if HAVE_GETTIMEOFDAY
-@@ -1455,6 +1539,14 @@
+@@ -1460,6 +1544,14 @@ int main(int argc, char *argv[])
case 's': /* generate highlighted HTML from source */
behavior = PHP_MODE_HIGHLIGHT;
break;
}
-@@ -1517,6 +1609,19 @@
+@@ -1524,6 +1616,19 @@ consult the installation file that came with this distribution, or visit \n\
#endif /* FORCE_CGI_REDIRECT */
#if PHP_FASTCGI
if (bindpath) {
fcgi_fd = fcgi_listen(bindpath, 128);
if (fcgi_fd < 0) {
-@@ -1531,6 +1636,9 @@
+@@ -1538,6 +1643,9 @@ consult the installation file that came with this distribution, or visit \n\
if (fastcgi) {
/* How many times to run PHP scripts before dying */
if (getenv("PHP_FCGI_MAX_REQUESTS")) {
max_requests = atoi(getenv("PHP_FCGI_MAX_REQUESTS"));
if (max_requests < 0) {
-@@ -1548,6 +1656,9 @@
+@@ -1555,6 +1663,9 @@ consult the installation file that came with this distribution, or visit \n\
#ifndef PHP_WIN32
/* Pre-fork, if required */
if (getenv("PHP_FCGI_CHILDREN")) {
char * children_str = getenv("PHP_FCGI_CHILDREN");
children = atoi(children_str);
-@@ -1697,6 +1808,8 @@
+@@ -1704,6 +1815,8 @@ consult the installation file that came with this distribution, or visit \n\
#endif
#if PHP_FASTCGI
SG(server_context) = (void *) &request;
#else
SG(server_context) = (void *) 1; /* avoid server_context==NULL checks */
-@@ -1704,6 +1817,10 @@
+@@ -1711,6 +1824,10 @@ consult the installation file that came with this distribution, or visit \n\
init_request_info(TSRMLS_C);
CG(interactive) = 0;
if (!cgi
#if PHP_FASTCGI
&& !fastcgi
-@@ -1984,6 +2101,10 @@
+@@ -1994,6 +2111,10 @@ consult the installation file that came with this distribution, or visit \n\
}
}
switch (behavior) {
case PHP_MODE_STANDARD:
php_execute_script(&file_handle TSRMLS_CC);
-@@ -2036,6 +2157,10 @@
+@@ -2046,6 +2167,10 @@ consult the installation file that came with this distribution, or visit \n\
#if PHP_FASTCGI
fastcgi_request_done:
#endif
{
char *path_translated;
-@@ -2049,6 +2174,16 @@
+@@ -2059,6 +2184,16 @@ fastcgi_request_done:
SG(request_info).path_translated = path_translated;
}
php_request_shutdown((void *) 0);
if (exit_status == 0) {
exit_status = EG(exit_status);
-@@ -2086,15 +2221,20 @@
+@@ -2096,15 +2231,20 @@ fastcgi_request_done:
if (bindpath) {
free(bindpath);
}
#endif
if (cgi_sapi_module.php_ini_path_override) {
---- php-5.2.8.vanilla/sapi/cgi/config9.m4 2007-07-12 03:20:36.000000000 +0400
-+++ php-5.2.8.fpm/sapi/cgi/config9.m4 2008-07-20 20:46:41.000000000 +0400
-@@ -22,6 +22,10 @@
+--- php-5.2.17/sapi/cgi/config9.m4~ 2012-02-27 14:44:23.000000000 +0200
++++ php-5.2.17/sapi/cgi/config9.m4 2012-02-27 14:48:07.279580606 +0200
+@@ -22,6 +22,10 @@ PHP_ARG_ENABLE(path-info-check,,
[ --disable-path-info-check CGI: If this is disabled, paths such as
/info.php/test?a=b will fail to work], yes, no)
dnl
dnl CGI setup
dnl
-@@ -54,6 +58,20 @@
+@@ -54,6 +58,20 @@ if test "$PHP_SAPI" = "default"; then
AC_DEFINE_UNQUOTED(PHP_FASTCGI, $PHP_ENABLE_FASTCGI, [ ])
AC_MSG_RESULT($PHP_FASTCGI)
;;
*darwin*)
- BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
-+ BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(SAPI_EXTRA_LIBS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
++ BUILD_CGI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_SAPI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(SAPI_EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
;;
*)
- BUILD_CGI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) libphp_common.la \$(PHP_SAPI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CGI_PATH)"
;;
esac
---- php-5.2.8.vanilla/sapi/cgi/fastcgi.c 2008-10-21 20:43:59.000000000 +0400
-+++ php-5.2.8.fpm/sapi/cgi/fastcgi.c 2008-12-09 04:02:34.000000000 +0300
+diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c
+--- a/sapi/cgi/fastcgi.c
++++ b/sapi/cgi/fastcgi.c
@@ -27,6 +27,11 @@
#include <stdarg.h>
#include <errno.h>
#ifdef _WIN32
#include <windows.h>
-@@ -234,6 +239,8 @@
+@@ -234,6 +239,8 @@ int fcgi_init(void)
} else {
return is_fastcgi = 0;
}
#endif
}
return is_fastcgi;
-@@ -249,12 +256,27 @@
+@@ -249,14 +256,26 @@ int fcgi_is_fastcgi(void)
}
}
if (is_initialized) {
zend_hash_destroy(&fcgi_mgmt_vars);
}
-- is_fastcgi = 0;
-+ is_fastcgi = 1;
+ is_fastcgi = 0;
+
-+ if (allowed_clients) {
-+ free(allowed_clients);
+ if (allowed_clients) {
+ free(allowed_clients);
+ allowed_clients = 0;
-+ }
+ }
}
- #ifdef _WIN32
-@@ -327,6 +349,41 @@
+@@ -330,6 +349,41 @@ out_fail:
}
#endif
static int is_port_number(const char *bindpath)
{
while (*bindpath) {
-@@ -455,38 +512,6 @@
+@@ -458,38 +512,6 @@ int fcgi_listen(const char *path, int backlog)
if (!tcp) {
chmod(path, 0777);
- } else {
-- char *ip = getenv("FCGI_WEB_SERVER_ADDRS");
-- char *cur, *end;
-- int n;
--
-- if (ip) {
-- ip = strdup(ip);
-- cur = ip;
-- n = 0;
-- while (*cur) {
-- if (*cur == ',') n++;
-- cur++;
-- }
-- allowed_clients = malloc(sizeof(in_addr_t) * (n+2));
-- n = 0;
-- cur = ip;
-- while (cur) {
-- end = strchr(cur, ',');
-- if (end) {
-- *end = 0;
-- end++;
-- }
-- allowed_clients[n] = inet_addr(cur);
-- if (allowed_clients[n] == INADDR_NONE) {
+- char *ip = getenv("FCGI_WEB_SERVER_ADDRS");
+- char *cur, *end;
+- int n;
+-
+- if (ip) {
+- ip = strdup(ip);
+- cur = ip;
+- n = 0;
+- while (*cur) {
+- if (*cur == ',') n++;
+- cur++;
+- }
+- allowed_clients = malloc(sizeof(in_addr_t) * (n+2));
+- n = 0;
+- cur = ip;
+- while (cur) {
+- end = strchr(cur, ',');
+- if (end) {
+- *end = 0;
+- end++;
+- }
+- allowed_clients[n] = inet_addr(cur);
+- if (allowed_clients[n] == INADDR_NONE) {
- fprintf(stderr, "Wrong IP address '%s' in FCGI_WEB_SERVER_ADDRS\n", cur);
-- }
-- n++;
-- cur = end;
-- }
-- allowed_clients[n] = INADDR_NONE;
+- }
+- n++;
+- cur = end;
+- }
+- allowed_clients[n] = INADDR_NONE;
- free(ip);
- }
}
if (!is_initialized) {
-@@ -863,7 +888,7 @@
+@@ -866,7 +888,7 @@ int fcgi_read(fcgi_request *req, char *str, int len)
return n;
}
{
if (destroy) {
zend_hash_destroy(&req->env);
-@@ -903,6 +928,10 @@
+@@ -906,6 +928,10 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy)
close(req->fd);
#endif
req->fd = -1;
}
}
-@@ -950,6 +979,10 @@
+@@ -953,6 +979,10 @@ int fcgi_accept_request(fcgi_request *req)
sa_t sa;
socklen_t len = sizeof(sa);
FCGI_LOCK(req->listen_socket);
req->fd = accept(listen_socket, (struct sockaddr *)&sa, &len);
FCGI_UNLOCK(req->listen_socket);
-@@ -985,6 +1018,11 @@
+@@ -988,6 +1018,11 @@ int fcgi_accept_request(fcgi_request *req)
break;
#else
if (req->fd >= 0) {
#if defined(HAVE_SYS_POLL_H) && defined(HAVE_POLL)
struct pollfd fds;
int ret;
---- php-5.2.8.vanilla/sapi/cgi/fastcgi.h 2008-10-21 20:43:59.000000000 +0400
-+++ php-5.2.8.fpm/sapi/cgi/fastcgi.h 2008-12-09 04:02:39.000000000 +0300
-@@ -114,6 +114,9 @@
+diff --git a/sapi/cgi/fastcgi.h b/sapi/cgi/fastcgi.h
+--- a/sapi/cgi/fastcgi.h
++++ b/sapi/cgi/fastcgi.h
+@@ -114,6 +114,9 @@ typedef struct _fcgi_request {
int fcgi_init(void);
void fcgi_shutdown(void);
int fcgi_is_fastcgi(void);
int fcgi_in_shutdown(void);
int fcgi_listen(const char *path, int backlog);
void fcgi_init_request(fcgi_request *req, int listen_socket);
-@@ -128,6 +131,8 @@
+@@ -128,6 +131,8 @@ int fcgi_read(fcgi_request *req, char *str, int len);
int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int len);
int fcgi_flush(fcgi_request *req, int close);
#ifdef PHP_WIN32
void fcgi_impersonate(void);
#endif
---- php-5.2.8.vanilla/sapi/cgi/fpm/acinclude.m4 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/acinclude.m4 2008-11-16 17:44:51.000000000 +0300
+diff --git a/sapi/cgi/fpm/Makefile.frag b/sapi/cgi/fpm/Makefile.frag
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/Makefile.frag
+@@ -0,0 +1,21 @@
++
++install-fpm: sapi/cgi/fpm/php-fpm.conf sapi/cgi/fpm/php-fpm
++ @echo "Installing FPM config: $(INSTALL_ROOT)$(php_fpm_conf_path)"
++ -@$(mkinstalldirs) \
++ $(INSTALL_ROOT)$(prefix)/sbin \
++ `dirname "$(INSTALL_ROOT)$(php_fpm_conf_path)"` \
++ `dirname "$(INSTALL_ROOT)$(php_fpm_log_path)"` \
++ `dirname "$(INSTALL_ROOT)$(php_fpm_pid_path)"`
++ -@if test -r "$(INSTALL_ROOT)$(php_fpm_conf_path)" ; then \
++ dest=`basename "$(php_fpm_conf_path)"`.default ; \
++ echo " (installing as $$dest)" ; \
++ else \
++ dest=`basename "$(php_fpm_conf_path)"` ; \
++ fi ; \
++ $(INSTALL_DATA) $(top_builddir)/sapi/cgi/fpm/php-fpm.conf $(INSTALL_ROOT)`dirname "$(php_fpm_conf_path)"`/$$dest
++ @echo "Installing init.d script: $(INSTALL_ROOT)$(prefix)/sbin/php-fpm"
++ -@$(INSTALL) -m 0755 $(top_builddir)/sapi/cgi/fpm/php-fpm $(INSTALL_ROOT)$(prefix)/sbin/php-fpm
++
++$(top_builddir)/libevent/libevent.a: $(top_builddir)/libevent/Makefile
++ cd $(top_builddir)/libevent && $(MAKE) libevent.a
++
+diff --git a/sapi/cgi/fpm/acinclude.m4 b/sapi/cgi/fpm/acinclude.m4
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/acinclude.m4
@@ -0,0 +1,377 @@
+
+AC_DEFUN([AC_FPM_CHECK_FUNC],
+ AC_MSG_RESULT([no])
+ ])
+])
---- php-5.2.8.vanilla/sapi/cgi/fpm/conf/php-fpm.conf.in 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/conf/php-fpm.conf.in 2008-05-23 01:08:35.000000000 +0400
+diff --git a/sapi/cgi/fpm/conf/php-fpm.conf.in b/sapi/cgi/fpm/conf/php-fpm.conf.in
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/conf/php-fpm.conf.in
@@ -0,0 +1,156 @@
+<?xml version="1.0" ?>
+<configuration>
+ </workers>
+
+</configuration>
---- php-5.2.8.vanilla/sapi/cgi/fpm/config.m4 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/config.m4 2008-12-13 07:21:53.000000000 +0300
+diff --git a/sapi/cgi/fpm/config.m4 b/sapi/cgi/fpm/config.m4
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/config.m4
@@ -0,0 +1,117 @@
+
-+FPM_VERSION="0.5.10"
++FPM_VERSION="0.5.14"
+
+PHP_ARG_WITH(fpm-conf, for php-fpm config file path,
+[ --with-fpm-conf=PATH Set the path for php-fpm configuration file [PREFIX/etc/php-fpm.conf]], \$prefix/etc/php-fpm.conf, no)
+PHP_OUTPUT(sapi/cgi/fpm/fpm_autoconf.h)
+PHP_OUTPUT(sapi/cgi/fpm/php-fpm.conf:sapi/cgi/fpm/conf/php-fpm.conf.in)
+PHP_OUTPUT(sapi/cgi/fpm/php-fpm:sapi/cgi/fpm/init.d/php-fpm.in)
-diff -Nru php-5.2.8.vanilla/sapi/cgi/fpm/fpm_arrays.h php-5.2.8.fpm/sapi/cgi/fpm/fpm_arrays.h
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_arrays.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_arrays.h 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm.c b/sapi/cgi/fpm/fpm.c
+new file mode 100644
+index 0000000..9db2c9b
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm.c
+@@ -0,0 +1,84 @@
++
++ /* $Id$ */
++ /* (c) 2007,2008 Andrei Nigmatulin */
++
++#include "fpm_config.h"
++
++#include <stdlib.h> /* for exit */
++
++#include "fpm.h"
++#include "fpm_children.h"
++#include "fpm_signals.h"
++#include "fpm_env.h"
++#include "fpm_events.h"
++#include "fpm_cleanup.h"
++#include "fpm_php.h"
++#include "fpm_sockets.h"
++#include "fpm_unix.h"
++#include "fpm_process_ctl.h"
++#include "fpm_conf.h"
++#include "fpm_worker_pool.h"
++#include "fpm_stdio.h"
++#include "zlog.h"
++
++int fpm;
++
++struct fpm_globals_s fpm_globals;
++
++int fpm_init(int argc, char **argv, char *config)
++{
++ fpm_globals.argc = argc;
++ fpm_globals.argv = argv;
++ fpm_globals.config = config;
++
++ if (0 > fpm_php_init_main() ||
++ 0 > fpm_stdio_init_main() ||
++ 0 > fpm_conf_init_main() ||
++ 0 > fpm_unix_init_main() ||
++ 0 > fpm_env_init_main() ||
++ 0 > fpm_signals_init_main() ||
++ 0 > fpm_pctl_init_main() ||
++ 0 > fpm_children_init_main() ||
++ 0 > fpm_sockets_init_main() ||
++ 0 > fpm_worker_pool_init_main() ||
++ 0 > fpm_event_init_main()) {
++ return -1;
++ }
++
++ if (0 > fpm_conf_write_pid()) {
++ return -1;
++ }
++
++ zlog(ZLOG_STUFF, ZLOG_NOTICE, "fpm is running, pid %d", (int) fpm_globals.parent_pid);
++
++ return 0;
++}
++
++/* children: return listening socket
++ parent: never return */
++int fpm_run(int *max_requests)
++{
++ struct fpm_worker_pool_s *wp;
++
++ /* create initial children in all pools */
++ for (wp = fpm_worker_all_pools; wp; wp = wp->next) {
++ int is_parent;
++
++ is_parent = fpm_children_create_initial(wp);
++
++ if (!is_parent) {
++ goto run_child;
++ }
++ }
++
++ /* run event loop forever */
++ fpm_event_loop();
++
++run_child: /* only workers reach this point */
++
++ fpm_cleanups_run(FPM_CLEANUP_CHILD);
++
++ *max_requests = fpm_globals.max_requests;
++ return fpm_globals.listening_socket;
++}
++
+diff --git a/sapi/cgi/fpm/fpm.h b/sapi/cgi/fpm/fpm.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm.h
+@@ -0,0 +1,30 @@
++
++ /* $Id$ */
++ /* (c) 2007,2008 Andrei Nigmatulin */
++
++#ifndef FPM_H
++#define FPM_H 1
++
++#include <unistd.h>
++
++int fpm_run(int *max_requests);
++int fpm_init(int argc, char **argv, char *config);
++
++struct fpm_globals_s {
++ pid_t parent_pid;
++ int argc;
++ char **argv;
++ char *config;
++ int running_children;
++ int error_log_fd;
++ int log_level;
++ int listening_socket; /* for this child */
++ int max_requests; /* for this child */
++ int is_child;
++};
++
++extern struct fpm_globals_s fpm_globals;
++
++extern int fpm;
++
++#endif
+diff --git a/sapi/cgi/fpm/fpm_arrays.h b/sapi/cgi/fpm/fpm_arrays.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_arrays.h
@@ -0,0 +1,110 @@
+
+ /* $Id$ */
+}
+
+#endif
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_atomic.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_atomic.h 2008-09-19 03:34:11.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_atomic.h b/sapi/cgi/fpm/fpm_atomic.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_atomic.h
@@ -0,0 +1,85 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_autoconf.h.in 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_autoconf.h.in 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_autoconf.h.in b/sapi/cgi/fpm/fpm_autoconf.h.in
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_autoconf.h.in
@@ -0,0 +1,9 @@
+
+ /* $Id$ */
+#define PHP_FPM_LOG_PATH "@php_fpm_log_path@"
+#define PHP_FPM_PID_PATH "@php_fpm_pid_path@"
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm.c 2008-07-20 20:38:31.000000000 +0400
-@@ -0,0 +1,84 @@
-+
-+ /* $Id$ */
-+ /* (c) 2007,2008 Andrei Nigmatulin */
-+
-+#include "fpm_config.h"
-+
-+#include <stdlib.h> /* for exit */
-+
-+#include "fpm.h"
-+#include "fpm_children.h"
-+#include "fpm_signals.h"
-+#include "fpm_env.h"
-+#include "fpm_events.h"
-+#include "fpm_cleanup.h"
-+#include "fpm_php.h"
-+#include "fpm_sockets.h"
-+#include "fpm_unix.h"
-+#include "fpm_process_ctl.h"
-+#include "fpm_conf.h"
-+#include "fpm_worker_pool.h"
-+#include "fpm_stdio.h"
-+#include "zlog.h"
-+
-+int fpm;
-+
-+struct fpm_globals_s fpm_globals;
-+
-+int fpm_init(int argc, char **argv, char *config)
-+{
-+ fpm_globals.argc = argc;
-+ fpm_globals.argv = argv;
-+ fpm_globals.config = config;
-+
-+ if (0 > fpm_php_init_main() ||
-+ 0 > fpm_stdio_init_main() ||
-+ 0 > fpm_conf_init_main() ||
-+ 0 > fpm_unix_init_main() ||
-+ 0 > fpm_env_init_main() ||
-+ 0 > fpm_signals_init_main() ||
-+ 0 > fpm_pctl_init_main() ||
-+ 0 > fpm_children_init_main() ||
-+ 0 > fpm_sockets_init_main() ||
-+ 0 > fpm_worker_pool_init_main() ||
-+ 0 > fpm_event_init_main()) {
-+ return -1;
-+ }
-+
-+ if (0 > fpm_conf_write_pid()) {
-+ return -1;
-+ }
-+
-+ zlog(ZLOG_STUFF, ZLOG_NOTICE, "fpm is running, pid %d", (int) fpm_globals.parent_pid);
-+
-+ return 0;
-+}
-+
-+/* children: return listening socket
-+ parent: never return */
-+int fpm_run(int *max_requests)
-+{
-+ struct fpm_worker_pool_s *wp;
-+
-+ /* create initial children in all pools */
-+ for (wp = fpm_worker_all_pools; wp; wp = wp->next) {
-+ int is_parent;
-+
-+ is_parent = fpm_children_create_initial(wp);
-+
-+ if (!is_parent) {
-+ goto run_child;
-+ }
-+ }
-+
-+ /* run event loop forever */
-+ fpm_event_loop();
-+
-+run_child: /* only workers reach this point */
-+
-+ fpm_cleanups_run(FPM_CLEANUP_CHILD);
-+
-+ *max_requests = fpm_globals.max_requests;
-+ return fpm_globals.listening_socket;
-+}
-+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_children.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_children.c 2008-12-13 06:21:18.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_children.c b/sapi/cgi/fpm/fpm_children.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_children.c
@@ -0,0 +1,385 @@
+
+ /* $Id$ */
+ return 0;
+}
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_children.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_children.h 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_children.h b/sapi/cgi/fpm/fpm_children.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_children.h
@@ -0,0 +1,33 @@
+
+ /* $Id$ */
+};
+
+#endif
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_cleanup.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_cleanup.c 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_cleanup.c b/sapi/cgi/fpm/fpm_cleanup.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_cleanup.c
@@ -0,0 +1,51 @@
+
+ /* $Id$ */
+ fpm_array_free(&cleanups);
+}
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_cleanup.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_cleanup.h 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_cleanup.h b/sapi/cgi/fpm/fpm_cleanup.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_cleanup.h
@@ -0,0 +1,21 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_clock.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_clock.c 2008-09-19 03:19:59.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_clock.c b/sapi/cgi/fpm/fpm_clock.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_clock.c
@@ -0,0 +1,115 @@
+
+ /* $Id$ */
+}
+
+#endif
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_clock.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_clock.h 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_clock.h b/sapi/cgi/fpm/fpm_clock.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_clock.h
@@ -0,0 +1,13 @@
+
+ /* $Id$ */
+int fpm_clock_get(struct timeval *tv);
+
+#endif
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_conf.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_conf.c 2008-12-13 06:50:29.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_conf.c b/sapi/cgi/fpm/fpm_conf.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_conf.c
@@ -0,0 +1,532 @@
+
+ /* $Id$ */
+
+ return 0;
+}
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_conf.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_conf.h 2008-12-13 06:46:49.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_conf.h b/sapi/cgi/fpm/fpm_conf.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_conf.h
@@ -0,0 +1,73 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_config.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_config.h 2008-05-25 04:30:43.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_config.h b/sapi/cgi/fpm/fpm_config.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_config.h
@@ -0,0 +1,39 @@
+
+ /* $Id$ */
+#define HAVE_FPM_TRACE 0
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_env.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_env.c 2008-09-19 03:19:59.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_env.c b/sapi/cgi/fpm/fpm_env.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_env.c
@@ -0,0 +1,125 @@
+
+ /* $Id$ */
+
+ return 0;
+}
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_env.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_env.h 2008-09-19 03:19:59.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_env.h b/sapi/cgi/fpm/fpm_env.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_env.h
@@ -0,0 +1,24 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_events.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_events.c 2008-12-13 06:21:18.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_events.c b/sapi/cgi/fpm/fpm_events.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_events.c
@@ -0,0 +1,135 @@
+
+ /* $Id$ */
+ (*ev->ev_callback)( (int) ev->ev_fd, (short) ev->ev_res, ev->ev_arg);
+}
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_events.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_events.h 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_events.h b/sapi/cgi/fpm/fpm_events.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_events.h
@@ -0,0 +1,16 @@
+
+ /* $Id$ */
+
+
+#endif
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm.h 2008-05-24 21:38:47.000000000 +0400
-@@ -0,0 +1,30 @@
-+
-+ /* $Id$ */
-+ /* (c) 2007,2008 Andrei Nigmatulin */
-+
-+#ifndef FPM_H
-+#define FPM_H 1
-+
-+#include <unistd.h>
-+
-+int fpm_run(int *max_requests);
-+int fpm_init(int argc, char **argv, char *config);
-+
-+struct fpm_globals_s {
-+ pid_t parent_pid;
-+ int argc;
-+ char **argv;
-+ char *config;
-+ int running_children;
-+ int error_log_fd;
-+ int log_level;
-+ int listening_socket; /* for this child */
-+ int max_requests; /* for this child */
-+ int is_child;
-+};
-+
-+extern struct fpm_globals_s fpm_globals;
-+
-+extern int fpm;
-+
-+#endif
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_php.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_php.c 2008-12-13 06:21:18.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_php.c b/sapi/cgi/fpm/fpm_php.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_php.c
@@ -0,0 +1,190 @@
+
+ /* $Id$ */
+
+ return 0;
+}
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_php.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_php.h 2008-11-15 03:57:24.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_php.h b/sapi/cgi/fpm/fpm_php.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_php.h
@@ -0,0 +1,22 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_php_trace.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_php_trace.c 2008-11-15 03:57:24.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_php_trace.c b/sapi/cgi/fpm/fpm_php_trace.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_php_trace.c
@@ -0,0 +1,171 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_php_trace.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_php_trace.h 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_php_trace.h b/sapi/cgi/fpm/fpm_php_trace.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_php_trace.h
@@ -0,0 +1,13 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_process_ctl.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_process_ctl.c 2008-12-13 06:21:18.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_process_ctl.c b/sapi/cgi/fpm/fpm_process_ctl.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_process_ctl.c
@@ -0,0 +1,354 @@
+
+ /* $Id$ */
+ evtimer_add(&heartbeat, &tv);
+}
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_process_ctl.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_process_ctl.h 2008-07-21 01:33:10.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_process_ctl.h b/sapi/cgi/fpm/fpm_process_ctl.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_process_ctl.h
@@ -0,0 +1,39 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_request.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_request.c 2008-11-15 03:57:24.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_request.c b/sapi/cgi/fpm/fpm_request.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_request.c
@@ -0,0 +1,164 @@
+
+ /* $Id$ */
+
+}
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_request.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_request.h 2008-07-20 05:47:16.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_request.h b/sapi/cgi/fpm/fpm_request.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_request.h
@@ -0,0 +1,27 @@
+
+ /* $Id$ */
+};
+
+#endif
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_shm.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_shm.c 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_shm.c b/sapi/cgi/fpm/fpm_shm.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_shm.c
@@ -0,0 +1,100 @@
+
+ /* $Id$ */
+ return ret;
+}
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_shm.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_shm.h 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_shm.h b/sapi/cgi/fpm/fpm_shm.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_shm.h
@@ -0,0 +1,22 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_shm_slots.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_shm_slots.c 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_shm_slots.c b/sapi/cgi/fpm/fpm_shm_slots.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_shm_slots.c
@@ -0,0 +1,127 @@
+
+ /* $Id$ */
+ s->lock = 0;
+}
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_shm_slots.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_shm_slots.h 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_shm_slots.h b/sapi/cgi/fpm/fpm_shm_slots.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_shm_slots.h
@@ -0,0 +1,43 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_signals.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_signals.c 2008-08-26 19:09:15.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_signals.c b/sapi/cgi/fpm/fpm_signals.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_signals.c
@@ -0,0 +1,252 @@
+
+ /* $Id$ */
+{
+ return sp[0];
+}
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_signals.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_signals.h 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_signals.h b/sapi/cgi/fpm/fpm_signals.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_signals.h
@@ -0,0 +1,16 @@
+
+ /* $Id$ */
+extern const char *fpm_signal_names[NSIG + 1];
+
+#endif
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_sockets.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_sockets.c 2008-12-13 06:21:18.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_sockets.c b/sapi/cgi/fpm/fpm_sockets.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_sockets.c
@@ -0,0 +1,427 @@
+
+ /* $Id$ */
+
+ return 0;
+}
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_sockets.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_sockets.h 2008-08-26 19:09:15.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_sockets.h b/sapi/cgi/fpm/fpm_sockets.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_sockets.h
@@ -0,0 +1,37 @@
+
+ /* $Id$ */
+ (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[3]
+
+#endif
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_stdio.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_stdio.c 2008-12-13 06:32:24.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_stdio.c b/sapi/cgi/fpm/fpm_stdio.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_stdio.c
@@ -0,0 +1,286 @@
+
+ /* $Id$ */
+
+ return 0;
+}
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_stdio.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_stdio.h 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_stdio.h b/sapi/cgi/fpm/fpm_stdio.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_stdio.h
@@ -0,0 +1,20 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_str.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_str.h 2008-05-24 21:38:47.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_str.h b/sapi/cgi/fpm/fpm_str.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_str.h
@@ -0,0 +1,49 @@
+
+ /* $Id$ */
+}
+
+#endif
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_trace.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_trace.c 2008-07-21 00:59:00.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_trace.c b/sapi/cgi/fpm/fpm_trace.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_trace.c
@@ -0,0 +1,46 @@
+
+ /* $Id$ */
+ }
+}
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_trace.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_trace.h 2008-07-21 02:43:39.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_trace.h b/sapi/cgi/fpm/fpm_trace.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_trace.h
@@ -0,0 +1,17 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_trace_mach.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_trace_mach.c 2008-08-26 19:09:15.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_trace_mach.c b/sapi/cgi/fpm/fpm_trace_mach.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_trace_mach.c
@@ -0,0 +1,102 @@
+
+ /* $Id$ */
+ return 0;
+}
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_trace_pread.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_trace_pread.c 2008-08-26 19:09:15.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_trace_pread.c b/sapi/cgi/fpm/fpm_trace_pread.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_trace_pread.c
@@ -0,0 +1,67 @@
+
+ /* $Id$ */
+ return 0;
+}
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_trace_ptrace.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_trace_ptrace.c 2008-09-19 03:34:11.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_trace_ptrace.c b/sapi/cgi/fpm/fpm_trace_ptrace.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_trace_ptrace.c
@@ -0,0 +1,85 @@
+
+ /* $Id$ */
+ return 0;
+}
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_unix.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_unix.c 2008-12-13 06:18:23.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_unix.c b/sapi/cgi/fpm/fpm_unix.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_unix.c
@@ -0,0 +1,289 @@
+
+ /* $Id$ */
+ getrlimit(RLIMIT_NOFILE, &r);
+
+ r.rlim_cur = (rlim_t) wp->config->rlimit_files;
-+
++ r.rlim_max = r.rlim_cur;
+ if (0 > setrlimit(RLIMIT_NOFILE, &r)) {
+ zlog(ZLOG_STUFF, ZLOG_SYSERROR, "setrlimit(RLIMIT_NOFILE) failed");
+ }
+ getrlimit(RLIMIT_CORE, &r);
+
+ r.rlim_cur = wp->config->rlimit_core == -1 ? (rlim_t) RLIM_INFINITY : (rlim_t) wp->config->rlimit_core;
-+
++ r.rlim_max = r.rlim_cur;
+ if (0 > setrlimit(RLIMIT_CORE, &r)) {
+ zlog(ZLOG_STUFF, ZLOG_SYSERROR, "setrlimit(RLIMIT_CORE) failed");
+ }
+
+ return 0;
+}
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_unix.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_unix.h 2008-05-25 17:21:13.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_unix.h b/sapi/cgi/fpm/fpm_unix.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_unix.h
@@ -0,0 +1,17 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_worker_pool.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_worker_pool.c 2008-12-13 06:21:18.000000000 +0300
+diff --git a/sapi/cgi/fpm/fpm_worker_pool.c b/sapi/cgi/fpm/fpm_worker_pool.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_worker_pool.c
@@ -0,0 +1,69 @@
+
+ /* $Id$ */
+
+ return 0;
+}
---- php-5.2.8.vanilla/sapi/cgi/fpm/fpm_worker_pool.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/fpm_worker_pool.h 2008-08-26 19:09:15.000000000 +0400
+diff --git a/sapi/cgi/fpm/fpm_worker_pool.h b/sapi/cgi/fpm/fpm_worker_pool.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/fpm_worker_pool.h
@@ -0,0 +1,46 @@
+
+ /* $Id$ */
+
+#endif
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/init.d/php-fpm.in 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/init.d/php-fpm.in 2008-08-26 19:09:18.000000000 +0400
+diff --git a/sapi/cgi/fpm/init.d/php-fpm.in b/sapi/cgi/fpm/init.d/php-fpm.in
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/init.d/php-fpm.in
@@ -0,0 +1,139 @@
+#! /bin/sh
+
+ ;;
+
+esac
---- php-5.2.8.vanilla/sapi/cgi/fpm/Makefile.frag 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/Makefile.frag 2008-03-28 21:58:30.000000000 +0300
-@@ -0,0 +1,21 @@
-+
-+install-fpm: sapi/cgi/fpm/php-fpm.conf sapi/cgi/fpm/php-fpm
-+ @echo "Installing FPM config: $(INSTALL_ROOT)$(php_fpm_conf_path)"
-+ -@$(mkinstalldirs) \
-+ $(INSTALL_ROOT)$(prefix)/sbin \
-+ `dirname "$(INSTALL_ROOT)$(php_fpm_conf_path)"` \
-+ `dirname "$(INSTALL_ROOT)$(php_fpm_log_path)"` \
-+ `dirname "$(INSTALL_ROOT)$(php_fpm_pid_path)"`
-+ -@if test -r "$(INSTALL_ROOT)$(php_fpm_conf_path)" ; then \
-+ dest=`basename "$(php_fpm_conf_path)"`.default ; \
-+ echo " (installing as $$dest)" ; \
-+ else \
-+ dest=`basename "$(php_fpm_conf_path)"` ; \
-+ fi ; \
-+ $(INSTALL_DATA) $(top_builddir)/sapi/cgi/fpm/php-fpm.conf $(INSTALL_ROOT)`dirname "$(php_fpm_conf_path)"`/$$dest
-+ @echo "Installing init.d script: $(INSTALL_ROOT)$(prefix)/sbin/php-fpm"
-+ -@$(INSTALL) -m 0755 $(top_builddir)/sapi/cgi/fpm/php-fpm $(INSTALL_ROOT)$(prefix)/sbin/php-fpm
-+
-+$(top_builddir)/libevent/libevent.a: $(top_builddir)/libevent/Makefile
-+ cd $(top_builddir)/libevent && $(MAKE) libevent.a
-+
---- php-5.2.8.vanilla/sapi/cgi/fpm/xml_config.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/xml_config.c 2008-08-26 19:09:15.000000000 +0400
+diff --git a/sapi/cgi/fpm/xml_config.c b/sapi/cgi/fpm/xml_config.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/xml_config.c
@@ -0,0 +1,278 @@
+
+ /* $Id$ */
+ return 0;
+}
+
---- php-5.2.8.vanilla/sapi/cgi/fpm/xml_config.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/xml_config.h 2008-09-19 03:02:58.000000000 +0400
+diff --git a/sapi/cgi/fpm/xml_config.h b/sapi/cgi/fpm/xml_config.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/xml_config.h
@@ -0,0 +1,43 @@
+
+ /* $Id$ */
+enum { XML_CONF_SCALAR = 1, XML_CONF_SUBSECTION = 2 };
+
+#endif
---- php-5.2.8.vanilla/sapi/cgi/fpm/zlog.c 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/zlog.c 2008-05-23 01:08:32.000000000 +0400
+diff --git a/sapi/cgi/fpm/zlog.c b/sapi/cgi/fpm/zlog.c
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/zlog.c
@@ -0,0 +1,113 @@
+
+ /* $Id$ */
+
+ write(zlog_fd > -1 ? zlog_fd : STDERR_FILENO, buf, len);
+}
---- php-5.2.8.vanilla/sapi/cgi/fpm/zlog.h 1970-01-01 03:00:00.000000000 +0300
-+++ php-5.2.8.fpm/sapi/cgi/fpm/zlog.h 2008-05-23 01:08:32.000000000 +0400
+diff --git a/sapi/cgi/fpm/zlog.h b/sapi/cgi/fpm/zlog.h
+new file mode 100644
+--- /dev/null
++++ b/sapi/cgi/fpm/zlog.h
@@ -0,0 +1,34 @@
+
+ /* $Id$ */
+#define ZLOG_SYSERROR (ZLOG_ERROR | ZLOG_HAVE_ERRNO)
+
+#endif
---- php-5.2.8.vanilla/sapi/cgi/Makefile.frag 2003-07-02 05:08:26.000000000 +0400
-+++ php-5.2.8.fpm/sapi/cgi/Makefile.frag 2008-05-01 20:42:06.000000000 +0400
-@@ -1,2 +1,2 @@
--$(SAPI_CGI_PATH): libphp_common.la $(PHP_SAPI_OBJS)
-+$(SAPI_CGI_PATH): libphp_common.la $(PHP_SAPI_OBJS) $(SAPI_EXTRA_DEPS)
- $(BUILD_CGI)