From f0abf7680380edc00c2204ba25692fdc9e5b0d46 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 4 Oct 2019 09:56:42 +0000 Subject: [PATCH] Fix build broken w/o --enable-cgid-fdpassing by r1867968: * modules/generators/cgi_common.h: Only define CGI bucket type if WANT_CGI_BUCKET is defined. * modules/generators/mod_cgi.c: Always include cgi_common.h, defining WANT_CGI_BUCKET iff APR_FILES_AS_SOCKETS is defined * modules/generators/mod_cgid.c: Always include cgi_common.h, defining WANT_CGI_BUCKET iff HAVE_CGID_FDPASSING (--enable-cgid-fdpassing). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1867971 13f79535-47bb-0310-9956-ffa450edef68 --- modules/generators/cgi_common.h | 3 +++ modules/generators/mod_cgi.c | 3 ++- modules/generators/mod_cgid.c | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/generators/cgi_common.h b/modules/generators/cgi_common.h index 0ff66f94e3..85c96855ea 100644 --- a/modules/generators/cgi_common.h +++ b/modules/generators/cgi_common.h @@ -44,6 +44,7 @@ static void discard_script_output(apr_bucket_brigade *bb) } } +#ifdef WANT_CGI_BUCKET /* A CGI bucket type is needed to catch any output to stderr from the * script; see PR 22030. */ static const apr_bucket_type_t bucket_type_cgi; @@ -235,6 +236,8 @@ static const apr_bucket_type_t bucket_type_cgi = { apr_bucket_copy_notimpl }; +#endif /* WANT_CGI_BUCKET */ + /* Handle the CGI response output, having set up the brigade with the * CGI or PIPE bucket as appropriate. */ static int cgi_handle_response(request_rec *r, int nph, apr_bucket_brigade *bb, diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index 5708aa0be6..8b96fd5190 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -569,8 +569,9 @@ static apr_status_t default_build_command(const char **cmd, const char ***argv, } #if APR_FILES_AS_SOCKETS -#include "cgi_common.h" +#define WANT_CGI_BUCKET #endif +#include "cgi_common.h" static int cgi_handler(request_rec *r) { diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 90cd529735..102d2b3193 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -1349,11 +1349,12 @@ static int log_script(request_rec *r, cgid_server_conf * conf, int ret, return ret; } -#ifdef HAVE_CGID_FDPASSING /* Pull in CGI bucket implementation. */ #define cgi_server_conf cgid_server_conf -#include "cgi_common.h" +#ifdef HAVE_CGID_FDPASSING +#define WANT_CGI_BUCKET #endif +#include "cgi_common.h" static int connect_to_daemon(int *sdptr, request_rec *r, cgid_server_conf *conf) -- 2.50.1