summaryrefslogtreecommitdiff
path: root/ace/Process.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-04-14 02:48:36 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-04-14 02:48:36 +0000
commit20e3bff25172800077a4e40a588150387391d412 (patch)
tree9a40771a618be27301f4b7745c2a9ed9b5c7f03a /ace/Process.cpp
parentacea4304a6db3b050a1a90760bdf1ae6fc8b5fec (diff)
downloadATCD-20e3bff25172800077a4e40a588150387391d412.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/Process.cpp')
-rw-r--r--ace/Process.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/ace/Process.cpp b/ace/Process.cpp
index f97ddab6c31..76d3b5d5710 100644
--- a/ace/Process.cpp
+++ b/ace/Process.cpp
@@ -119,7 +119,7 @@ ACE_Process::set_cwd (const TCHAR *cwd)
return 0;
}
-int
+pid_t
ACE_Process::start (char *argv[], char *envp[])
{
#if defined (ACE_WIN32)
@@ -179,17 +179,20 @@ ACE_Process::start (char *argv[], char *envp[])
if (this->cwd_[0] != '\0')
::chdir (cwd_);
- // Child process executes the command.
- int result;
+ if (argv != 0)
+ {
+ // Child process executes the command.
+ int result;
- if (envp == 0)
- result = ACE_OS::execv (argv[0], argv);
- else
- result = ACE_OS::execve (argv[0], argv, envp);
-
- if (result == -1)
- // If the execv fails, this child needs to exit.
- ACE_OS::exit (errno);
+ if (envp == 0)
+ result = ACE_OS::execv (argv[0], argv);
+ else
+ result = ACE_OS::execve (argv[0], argv, envp);
+
+ if (result == -1)
+ // If the execv fails, this child needs to exit.
+ ACE_OS::exit (errno);
+ }
default:
// Server process. The fork succeeded.
return 0;