From 61438bbdd4e226f1918773091c4d84db3b6eac60 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Wed, 7 Feb 2001 21:41:43 +0000 Subject: [PATCH] Fix graceful shutdown with the scoreboard changes. Basically, we want to set the sb_type only after we zero out the scoreboard. Before this, we were segfaulting when we tried to free() a shared memory scoreboard. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88013 13f79535-47bb-0310-9956-ffa450edef68 --- server/scoreboard.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/scoreboard.c b/server/scoreboard.c index 1f7d9602f1..abba2cf6b0 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -168,7 +168,6 @@ AP_DECLARE(void) ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_type) if (ap_scoreboard_image == NULL) { if (sb_type == SB_SHARED) { setup_shared(p); - ap_scoreboard_image->global.sb_type = SB_SHARED; } else { /* A simple malloc will suffice */ @@ -180,10 +179,10 @@ AP_DECLARE(void) ap_create_scoreboard(apr_pool_t *p, ap_scoreboard_e sb_type) perror(buf); /* o.k. since MM sets errno */ exit(APEXIT_INIT); } - ap_scoreboard_image->global.sb_type = SB_NOT_SHARED; } } memset(ap_scoreboard_image, 0, SCOREBOARD_SIZE); + ap_scoreboard_image->global.sb_type = sb_type; ap_scoreboard_image->global.running_generation = running_gen; ap_restart_time = apr_now(); apr_register_cleanup(p, NULL, ap_cleanup_scoreboard, apr_null_cleanup); -- 2.50.0