Changeset 99109 in vbox for trunk/src/VBox/Runtime/r3/posix/process-creation-posix.cpp
- Timestamp:
- Mar 22, 2023 10:13:00 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156474
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/process-creation-posix.cpp
r98103 r99109 216 216 static int rtProcPosixCreateInner(const char *pszExec, const char * const *papszArgs, RTENV hEnv, RTENV hEnvToUse, 217 217 uint32_t fFlags, const char *pszAsUser, uid_t uid, gid_t gid, 218 unsigned cRedirFds, int *paRedirFds, PRTPROCESS phProcess);218 unsigned cRedirFds, int *paRedirFds, void *pvExtraData, PRTPROCESS phProcess); 219 219 220 220 … … 1200 1200 RTPROCESS hProcess = NIL_RTPROCESS; 1201 1201 rc = rtProcPosixCreateInner(pszExec, apszArgs, hEnvToUse, hEnvToUse, 0 /*fFlags*/, 1202 pszAsUser, uid, gid, RT_ELEMENTS(aRedirFds), aRedirFds, &hProcess);1202 pszAsUser, uid, gid, RT_ELEMENTS(aRedirFds), aRedirFds, NULL /*pvExtraData*/, &hProcess); 1203 1203 if (RT_SUCCESS(rc)) 1204 1204 { … … 1713 1713 return VERR_PROC_DETACH_NOT_SUPPORTED; 1714 1714 #endif 1715 AssertReturn(pvExtraData == NULL || (fFlags & RTPROC_FLAGS_DESIRED_SESSION_ID), VERR_INVALID_PARAMETER); 1715 AssertReturn(pvExtraData == NULL || (fFlags & (RTPROC_FLAGS_DESIRED_SESSION_ID | RTPROC_FLAGS_CWD)), 1716 VERR_INVALID_PARAMETER); 1717 AssertReturn((fFlags & (RTPROC_FLAGS_DESIRED_SESSION_ID | RTPROC_FLAGS_CWD)) != (RTPROC_FLAGS_DESIRED_SESSION_ID | RTPROC_FLAGS_CWD), 1718 VERR_INVALID_PARAMETER); 1716 1719 1717 1720 /* … … 1895 1898 */ 1896 1899 rc = rtProcPosixCreateInner(pszNativeExec, papszArgsConverted, hEnv, hEnvToUse, fFlags, pszAsUser, uid, gid, 1897 RT_ELEMENTS(aStdFds), aStdFds, p hProcess);1900 RT_ELEMENTS(aStdFds), aStdFds, pvExtraData, phProcess); 1898 1901 1899 1902 } … … 1940 1943 static int rtProcPosixCreateInner(const char *pszNativeExec, const char * const *papszArgs, RTENV hEnv, RTENV hEnvToUse, 1941 1944 uint32_t fFlags, const char *pszAsUser, uid_t uid, gid_t gid, 1942 unsigned cRedirFds, int *paRedirFds, PRTPROCESS phProcess)1945 unsigned cRedirFds, int *paRedirFds, void *pvExtraData, PRTPROCESS phProcess) 1943 1946 { 1944 1947 /* … … 2037 2040 /** @todo OS/2: implement DETACHED (BACKGROUND stuff), see VbglR3Daemonize. */ 2038 2041 if ( uid == ~(uid_t)0 2039 && gid == ~(gid_t)0) 2042 && gid == ~(gid_t)0 2043 && !(fFlags & RTPROC_FLAGS_CWD)) 2040 2044 { 2041 2045 /* Spawn attributes. */ … … 2187 2191 } 2188 2192 #endif 2193 if (fFlags & RTPROC_FLAGS_CWD) 2194 { 2195 const char *pszCwd = (const char *)pvExtraData; 2196 if (pszCwd && *pszCwd) 2197 { 2198 rc = RTPathSetCurrent(pszCwd); 2199 if (RT_FAILURE(rc)) 2200 { 2201 /** @todo r=bela What is the right exit code here?? */ 2202 if (fFlags & RTPROC_FLAGS_DETACHED) 2203 _Exit(126); 2204 else 2205 /*exit*/_Exit(126); 2206 } 2207 } 2208 } 2189 2209 2190 2210 /*
Note:
See TracChangeset
for help on using the changeset viewer.