mpms: enforce assertion that unreachable code is not reached.
authorYann Ylavic <ylavic@apache.org>
Tue, 7 Oct 2014 15:46:05 +0000 (15:46 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 7 Oct 2014 15:46:05 +0000 (15:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629918 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/event/event.c
server/mpm/eventopt/eventopt.c
server/mpm/prefork/prefork.c
server/mpm/worker/worker.c

index d5e40c391624e697327d17946641f5a7b3b51c58..9f602c03ef91b643ee58300f392d535339dcffa1 100644 (file)
@@ -2604,6 +2604,8 @@ static int make_child(server_rec * s, int slot, int bucket)
         event_note_child_started(slot, getpid());
         child_main(0, 0);
         /* NOTREACHED */
+        ap_assert(0);
+        return -1;
     }
 
     if ((pid = fork()) == -1) {
@@ -2642,8 +2644,10 @@ static int make_child(server_rec * s, int slot, int bucket)
         apr_signal(SIGTERM, just_die);
         child_main(slot, bucket);
         /* NOTREACHED */
+        ap_assert(0);
+        return -1;
     }
-    /* else */
+
     if (ap_scoreboard_image->parent[slot].pid != 0) {
         /* This new child process is squatting on the scoreboard
          * entry owned by an exiting child process, which cannot
index f1089257bcfc86f1448ccc072813a07781bf30c1..f58aa8378f5e1834f426d7962d9ec17566778c53 100644 (file)
@@ -2426,6 +2426,8 @@ static int make_child(server_rec * s, int slot, int bucket)
         event_note_child_started(slot, getpid());
         child_main(0, 0);
         /* NOTREACHED */
+        ap_assert(0);
+        return -1;
     }
 
     if ((pid = fork()) == -1) {
@@ -2464,8 +2466,10 @@ static int make_child(server_rec * s, int slot, int bucket)
         apr_signal(SIGTERM, just_die);
         child_main(slot, bucket);
         /* NOTREACHED */
+        ap_assert(0);
+        return -1;
     }
-    /* else */
+
     if (ap_scoreboard_image->parent[slot].pid != 0) {
         /* This new child process is squatting on the scoreboard
          * entry owned by an exiting child process, which cannot
index 010ac93d93732a44bc979f92ea069b227c935190..6fa52b1dfaf19c03376999dab2f0f49bdd09ae74 100644 (file)
@@ -772,6 +772,8 @@ static int make_child(server_rec *s, int slot, int bucket)
         prefork_note_child_started(slot, getpid());
         child_main(slot, bucket);
         /* NOTREACHED */
+        ap_assert(0);
+        return -1;
     }
 
     (void) ap_update_child_status_from_indexes(slot, 0, SERVER_STARTING,
index f2c235efc68d3368f5883776ae6fc08db551a84f..acc8b1b688071935955701afdeca6f8f6fe83b7b 100644 (file)
@@ -1415,6 +1415,8 @@ static int make_child(server_rec *s, int slot, int bucket)
         worker_note_child_started(slot, getpid());
         child_main(0, 0);
         /* NOTREACHED */
+        ap_assert(0);
+        return -1;
     }
 
     if ((pid = fork()) == -1) {
@@ -1452,8 +1454,10 @@ static int make_child(server_rec *s, int slot, int bucket)
         apr_signal(SIGTERM, just_die);
         child_main(slot, bucket);
         /* NOTREACHED */
+        ap_assert(0);
+        return -1;
     }
-    /* else */
+
     if (ap_scoreboard_image->parent[slot].pid != 0) {
         /* This new child process is squatting on the scoreboard
          * entry owned by an exiting child process, which cannot