diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-11-11 22:30:10 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-11-11 22:30:10 +0000 |
commit | 8f4c9d969429f5ec8fa084bc83d1923880346e2b (patch) | |
tree | 2a0753571d90aded6700b445172f481300feaae6 /ace/Process_Manager.cpp | |
parent | db8cd3b95b8b7ed4d28d1241d2a816d91b84a43f (diff) | |
download | ATCD-8f4c9d969429f5ec8fa084bc83d1923880346e2b.tar.gz |
ChangeLogTag:Thu Nov 11 12:10:40 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
Diffstat (limited to 'ace/Process_Manager.cpp')
-rw-r--r-- | ace/Process_Manager.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ace/Process_Manager.cpp b/ace/Process_Manager.cpp index be9585a12f5..542059f4d67 100644 --- a/ace/Process_Manager.cpp +++ b/ace/Process_Manager.cpp @@ -168,6 +168,15 @@ ACE_Process_Manager::open (size_t size, { ACE_TRACE ("ACE_Process_Manager::open"); + // Set up a process group so that the thread that opened this + // Manager will be able to put children into its own group and wait + // for them. + if (ACE_OS::setpgid (0, 0) == -1) + ACE_ERROR ((LM_WARNING, + ASYS_TEXT ("%p.\n"), + ASYS_TEXT ("ACE_Process_Manager::open: can't create a " + "process group; some wait functions may fail"))); + if (r) { ACE_Event_Handler::reactor (r); @@ -420,8 +429,6 @@ ACE_Process_Manager::spawn (ACE_Process_Options &options) ACE_Managed_Process, ACE_INVALID_PID); - options.setgroup (ACE_OS::getpid ()); - return spawn (process, options); } @@ -433,6 +440,9 @@ ACE_Process_Manager::spawn (ACE_Process *process, { ACE_TRACE ("ACE_Process_Manager::spawn"); + if (options.getgroup () == ACE_INVALID_PID) + options.setgroup (ACE_OS::getpid ()); + pid_t pid = process->spawn (options); // Only include the pid in the parent's table. |