]> granicus.if.org Git - apache/commitdiff
Fix graceful shutdown with the scoreboard changes. Basically, we want
authorRyan Bloom <rbb@apache.org>
Wed, 7 Feb 2001 21:41:43 +0000 (21:41 +0000)
committerRyan Bloom <rbb@apache.org>
Wed, 7 Feb 2001 21:41:43 +0000 (21:41 +0000)
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

index 1f7d9602f10b4a487dbb489537ef930478582686..abba2cf6b0c5ea7861af3d640446a158203e9d97 100644 (file)
@@ -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);