simple_children.c revision e811d6e3aec5ec21c6de99652feff5d1f883daa6
842ae4bd224140319ae7feec1872b93dfd491143fielding/* Licensed to the Apache Software Foundation (ASF) under one or more
842ae4bd224140319ae7feec1872b93dfd491143fielding * contributor license agreements. See the NOTICE file distributed with
842ae4bd224140319ae7feec1872b93dfd491143fielding * this work for additional information regarding copyright ownership.
842ae4bd224140319ae7feec1872b93dfd491143fielding * The ASF licenses this file to You under the Apache License, Version 2.0
842ae4bd224140319ae7feec1872b93dfd491143fielding * (the "License"); you may not use this file except in compliance with
842ae4bd224140319ae7feec1872b93dfd491143fielding * the License. You may obtain a copy of the License at
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * Unless required by applicable law or agreed to in writing, software
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * distributed under the License is distributed on an "AS IS" BASIS,
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * See the License for the specific language governing permissions and
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * limitations under the License.
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianhstatic void
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh /* See comment in simple_spawn_child for why we check here. */
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianhstatic void
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb /* Although we could cut this off 'earlier', and not even invoke this
2d2eda71267231c2526be701fe655db125852c1ffielding * function, I would like to keep the functions invoked when in debug mode
30c289e6bc6d28d210b21edd800ab2cfc78a8381wrowe * to be as close as possible to those when not in debug... So, we just skip
cccd31fa4a72fe23cc3249c06db181b274a55a69gstein * the actual spawn itself, but go through all of the motions...
ef5650b61a8e35f3cc93ec07e73efc17ea329894jorton unsigned int count;
a261b81a1044c0e2ea3f21cf9b7019297bad16aajorton if (sc->run_single_process && sc->restart_num == 2) {
a261b81a1044c0e2ea3f21cf9b7019297bad16aajorton static int run = 0;
d71fd7cd9c4815d0647425f21ba3a803919a9148jorton /* This is kinda of hack, but rather than spawning a child process,
7c7372abe2484e7fcf81937b93496d1246e5b816gstein * we register the normal IO handlers in the main event loop....
7c7372abe2484e7fcf81937b93496d1246e5b816gstein if (run == 0) {
2d2eda71267231c2526be701fe655db125852c1ffielding /* kill some kids */
9d129b55f5a43abf43865c6b0eb6dd19bc22aba8ianh for (i = 0;
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb /* spawn some kids */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb for (i = 0;
2d2eda71267231c2526be701fe655db125852c1ffielding /* juuuuust right. */