VirtualBox

Changeset 35558 in vbox for trunk/src/VBox/Runtime/r3/posix


Ignore:
Timestamp:
Jan 14, 2011 1:30:33 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69442
Message:

Runtime/process: add a Solaris-specific flag to suppress changing the contract id (not used at the moment), and put a note in the runtime that the webservice self-daemonizing code relies on the fact that RTProcDaemonizeUsingFork keeps the contract id unchanged, in case someone cleans this up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/process-creation-posix.cpp

    r34708 r35558  
    356356    {
    357357# ifdef RT_OS_SOLARIS
    358         int templateFd = rtSolarisContractPreFork();
    359         if (templateFd == -1)
    360             return VERR_OPEN_FAILED;
     358        int templateFd = -1;
     359        if (!(fFlags & RTPROC_FLAGS_SAME_CONTRACT))
     360        {
     361            templateFd = rtSolarisContractPreFork();
     362            if (templateFd == -1)
     363                return VERR_OPEN_FAILED;
     364        }
    361365# endif /* RT_OS_SOLARIS */
    362366        pid = fork();
     
    364368        {
    365369# ifdef RT_OS_SOLARIS
    366             rtSolarisContractPostForkChild(templateFd);
     370            if (!(fFlags & RTPROC_FLAGS_SAME_CONTRACT))
     371                rtSolarisContractPostForkChild(templateFd);
    367372# endif /* RT_OS_SOLARIS */
    368373            setsid(); /* see comment above */
     
    374379        {
    375380#ifdef RT_OS_SOLARIS
    376             rtSolarisContractPostForkParent(templateFd, pid);
     381            if (!(fFlags & RTPROC_FLAGS_SAME_CONTRACT))
     382                rtSolarisContractPostForkParent(templateFd, pid);
    377383#endif /* RT_OS_SOLARIS */
    378384            if (pid > 0)
     
    657663    /* Create new session, fix up the standard file descriptors and the
    658664     * current working directory. */
     665    /** @todo r=klaus the webservice uses this function and assumes that the
     666     * contract id of the daemon is the same as that of the original process.
     667     * Whenever this code is changed this must still remain possible. */
    659668    pid_t newpgid = setsid();
    660669    int SavedErrno = errno;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette