Changeset 4475 in vbox for trunk/src/VBox/Runtime/r3/posix/process-posix.cpp
- Timestamp:
- Sep 1, 2007 1:21:19 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 24074
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/process-posix.cpp
r4071 r4475 42 42 #include <iprt/assert.h> 43 43 #include <iprt/err.h> 44 #include <iprt/env.h> 44 45 #include "internal/process.h" 45 46 46 47 47 48 48 RTR3DECL(int) RTProcCreate(const char *pszExec, const char * const *papszArgs, const char * const *papszEnv, unsigned fFlags, PRTPROCESS pProcess)49 RTR3DECL(int) RTProcCreate(const char *pszExec, const char * const *papszArgs, RTENV Env, unsigned fFlags, PRTPROCESS pProcess) 49 50 { 50 51 /* 51 52 * Validate input. 52 53 */ 53 if (!pszExec || !*pszExec) 54 { 55 AssertMsgFailed(("no exec\n")); 56 return VERR_INVALID_PARAMETER; 57 } 58 if (fFlags) 59 { 60 AssertMsgFailed(("invalid flags!\n")); 61 return VERR_INVALID_PARAMETER; 62 } 54 AssertPtrReturn(pszExec, VERR_INVALID_POINTER); 55 AssertReturn(*pszExec, VERR_INVALID_PARAMETER); 56 AssertReturn(!fFlags, VERR_INVALID_PARAMETER); 57 AssertReturn(Env != NIL_RTENV, VERR_INVALID_PARAMETER); 58 const char * const *papszEnv = RTEnvGetExecEnvP(Env); 59 AssertPtrReturn(papszEnv, VERR_INVALID_HANDLE); 63 60 /* later: path searching. */ 64 61 … … 100 97 /** @todo check if it requires any of those two attributes, don't remember atm. */ 101 98 int rc = posix_spawn(&pid, pszExec, NULL, NULL, (char * const *)papszArgs, 102 papszEnv ? (char * const *)papszEnv : environ);99 (char * const *)papszEnv); 103 100 if (!rc) 104 101 { … … 114 111 { 115 112 int rc; 116 if (papszEnv) 117 rc = execve(pszExec, (char * const *)papszArgs, (char * const *)papszEnv); 118 else 119 rc = execv(pszExec, (char * const *)papszArgs); 113 rc = execve(pszExec, (char * const *)papszArgs, (char * const *)papszEnv); 120 114 AssertReleaseMsgFailed(("execve returns %d errno=%d\n", rc, errno)); 121 115 exit(127);
Note:
See TracChangeset
for help on using the changeset viewer.