From: Martin Kraemer Date: Tue, 12 Jun 2001 08:39:03 +0000 (+0000) Subject: Fixes to produce the Cygwin 1.x binaries out-of-the-box; X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25bc9e3e26bf84d122f307ee2eaeb0b5601603c5;p=thirdparty%2Fapache%2Fhttpd.git Fixes to produce the Cygwin 1.x binaries out-of-the-box; Fix perform_idle_server_maintenance() for Cygwin: use SIGKILL rather than SIGUSR1 because the latter has no effect. PR: PR#7837 and PR#7838 Submitted by: Stipe Tolj Reviewed by: Martin Kraemer git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@89348 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/CHANGES b/src/CHANGES index 7c0a8e4c14e..ab31f005483 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -1,4 +1,9 @@ Changes with Apache 1.3.21 + + *) (Cygwin only) Fix problems with signals sent to child processes; + Improve auto-configuration for Cygwin. + [Stipe Tolj ] + *) Added Mod_Vhost_Alias to the project file so that it builds as an external module (VHOST.NLM). [Brad Nicholes ] diff --git a/src/Configure b/src/Configure index 27bfef93edf..36dfdf78570 100755 --- a/src/Configure +++ b/src/Configure @@ -840,7 +840,8 @@ case "$PLAT" in OSDIR="os/cygwin" CFLAGS="$CFLAGS -DCYGWIN" DEF_WANTHSREGEX=yes - LIBS="$LIBS -lcrypt" + DBM_LIB="-lgdbm" + LIBS="$LIBS -lcrypt $DBM_LIB" ;; *) # default: Catch systems we don't know about OS='Unknown and unsupported OS' diff --git a/src/helpers/binbuild.sh b/src/helpers/binbuild.sh index 53aa80ff1a9..e58830b882c 100755 --- a/src/helpers/binbuild.sh +++ b/src/helpers/binbuild.sh @@ -9,6 +9,8 @@ OS=`src/helpers/GuessOS` case "x$OS" in x*390*) CONFIGPARAM="--with-layout=BinaryDistribution --enable-module=most";; + *cygwin*) CONFIGPARAM="--with-layout=BinaryDistribution --enable-module=most \ + --enable-rule=SHARED_CORE --libexecdir=bin";; *) CONFIGPARAM="--with-layout=BinaryDistribution --enable-module=most --enable-shared=max";; esac APDIR=`pwd` diff --git a/src/helpers/install.sh b/src/helpers/install.sh index f0d2a14e951..403104ddd78 100755 --- a/src/helpers/install.sh +++ b/src/helpers/install.sh @@ -87,7 +87,11 @@ if [ -d $dst ]; then dst="$dst/`basename $src`" fi -# Add a possible extension (such as ".exe") to src and dst +# Check if we need to add an executable extension (such as ".exe") +# on specific OS to src and dst +if [ -f "$src.exe" ]; then + ext=".exe" +fi src="$src$ext" dst="$dst$ext" diff --git a/src/include/ap_config.h b/src/include/ap_config.h index 7b99fa8f5a4..233ff413054 100644 --- a/src/include/ap_config.h +++ b/src/include/ap_config.h @@ -955,6 +955,12 @@ typedef int rlim_t; #define JMP_BUF jmp_buf #define NO_KILLPG #define USE_LONGJMP +#define GDBM_STATIC +#define HAVE_MMAP 1 +#define USE_MMAP_SCOREBOARD +#define USE_MMAP_FILES +#define HAVE_SYSLOG 1 + #else /* Unknown system - Edit these to match */ diff --git a/src/main/http_main.c b/src/main/http_main.c index 8a4b4fcc885..5b6e096957b 100644 --- a/src/main/http_main.c +++ b/src/main/http_main.c @@ -4429,6 +4429,20 @@ static int idle_spawn_rate = 1; #endif static int hold_off_on_exponential_spawning; +/* + * Define the signal that is used to kill off children if idle_count + * is greater then ap_daemons_max_free. Usually we will use SIGUSR1 + * to gracefully shutdown, but unfortunatly some OS will need other + * signals to ensure that the child process is terminated and the + * scoreboard pool is not growing to infinity. This effect has been + * seen at least on Cygwin 1.x. -- Stipe Tolj + */ +#if defined(CYGWIN) +#define SIG_IDLE_KILL SIGKILL +#else +#define SIG_IDLE_KILL SIGUSR1 +#endif + static void perform_idle_server_maintenance(void) { int i; @@ -4508,9 +4522,10 @@ static void perform_idle_server_maintenance(void) if (idle_count > ap_daemons_max_free) { /* kill off one child... we use SIGUSR1 because that'll cause it to * shut down gracefully, in case it happened to pick up a request - * while we were counting + * while we were counting. Use the define SIG_IDLE_KILL to reflect + * which signal should be used on the specific OS. */ - kill(ap_scoreboard_image->parent[to_kill].pid, SIGUSR1); + kill(ap_scoreboard_image->parent[to_kill].pid, SIG_IDLE_KILL); idle_spawn_rate = 1; } else if (idle_count < ap_daemons_min_free) {