diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-02-28 20:13:32 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-02-28 20:13:32 +0000 |
commit | 0440219e8153953677a62bfecc3df271da2c0902 (patch) | |
tree | 2a3da2a69b30260cb8cbb027c38afe60a7262240 /examples/Shared_Malloc | |
parent | b9ef2bbd6da5db9e1764a3dab62aeb046d84c81b (diff) | |
download | ATCD-0440219e8153953677a62bfecc3df271da2c0902.tar.gz |
foo
Diffstat (limited to 'examples/Shared_Malloc')
-rw-r--r-- | examples/Shared_Malloc/test_malloc.cpp | 63 |
1 files changed, 29 insertions, 34 deletions
diff --git a/examples/Shared_Malloc/test_malloc.cpp b/examples/Shared_Malloc/test_malloc.cpp index 3d9be444297..41646d0105b 100644 --- a/examples/Shared_Malloc/test_malloc.cpp +++ b/examples/Shared_Malloc/test_malloc.cpp @@ -90,43 +90,38 @@ spawn (void) #endif /* ACE_HAS_THREADS */ } #if !defined (ACE_WIN32) - else + else if (ACE_OS::fork (Options::instance ()->program_name ()) == 0) { - if (ACE_OS::fork () == 0) + if (Options::instance ()->exec_slave ()) { - if (Options::instance ()->exec_slave ()) - { - char iterations[20]; - char msg_size[20]; + char iterations[20]; + char msg_size[20]; - ACE_OS::sprintf (iterations, "%d", Options::instance ()->iteration_count ()); - ACE_OS::sprintf (msg_size, "%d", Options::instance ()->max_msg_size ()); - - char *argv[8]; - argv[0] = (char *) Options::instance ()->slave_name (); - argv[1] = "-p"; - argv[2] = "-n"; - argv[3] = iterations; - argv[4] = "-L"; - argv[5] = msg_size; - argv[6] = Options::instance ()->debug () ? "-d" : ""; - argv[7] = (char *) 0; - - if (ACE_OS::execv (Options::instance ()->program_name (), argv) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "exec failed")); - ACE_OS::_exit (1); - } - else - { - ACE_LOG_MSG->sync (Options::instance ()->program_name ()); - - ACE_DEBUG ((LM_INFO, - "(%P|%t) about to recurse with iteration count = %d\n", - Options::instance ()->iteration_count ())); - - malloc_recurse (Options::instance ()->iteration_count ()); - ACE_OS::exit (0); - } + ACE_OS::sprintf (iterations, "%d", Options::instance ()->iteration_count ()); + ACE_OS::sprintf (msg_size, "%d", Options::instance ()->max_msg_size ()); + + char *argv[8]; + argv[0] = (char *) Options::instance ()->slave_name (); + argv[1] = "-p"; + argv[2] = "-n"; + argv[3] = iterations; + argv[4] = "-L"; + argv[5] = msg_size; + argv[6] = Options::instance ()->debug () ? "-d" : ""; + argv[7] = (char *) 0; + + if (ACE_OS::execv (Options::instance ()->program_name (), argv) == -1) + ACE_ERROR ((LM_ERROR, "%p\n", "exec failed")); + ACE_OS::_exit (1); + } + else + { + ACE_DEBUG ((LM_INFO, + "(%P|%t) about to recurse with iteration count = %d\n", + Options::instance ()->iteration_count ())); + + malloc_recurse (Options::instance ()->iteration_count ()); + ACE_OS::exit (0); } } #endif /* ACE_WIN32 */ |