VirtualBox

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


Ignore:
Timestamp:
Oct 20, 2009 8:55:51 AM (15 years ago)
Author:
vboxsync
Message:

temporarily back out r53642, r53640

File:
1 edited

Legend:

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

    r23869 r23892  
    110110    /*
    111111     * Spawn the child.
    112      *
    113      * HACK ALERT! Put the process into a new process group with pgid = pid
    114      * to make sure it differs from that of the parent process to ensure that
    115      * the IPRT waipit call doesn't race anyone (read XPCOM) doing group wide
    116      * waits.
    117112     */
    118113    pid_t pid;
     
    120115    if (!(fFlags & RTPROC_FLAGS_DAEMONIZE))
    121116    {
    122         posix_spawnattr_t Attr;
    123 
    124         rc = posix_spawnattr_init(&Attr);
     117        /** @todo check if it requires any of those two attributes, don't remember atm. */
     118        rc = posix_spawn(&pid, pszExec, NULL, NULL, (char * const *)papszArgs,
     119                         (char * const *)papszEnv);
    125120        if (!rc)
    126121        {
    127 # ifndef RT_OS_OS2 /* We don't need this on OS/2 and I don't recall if it's actually implemented. */
    128             rc = posix_spawnattr_setflags(&Attr, POSIX_SPAWN_SETPGROUP);
    129             Assert(rc == 0);
    130             if (!rc)
    131             {
    132                 rc = posix_spawnattr_setpgroup(&Attr, 0 /* pg == child pid */);
    133                 Assert(rc == 0);
    134             }
    135 # endif
    136             if (!rc)
    137             {
    138                 /** @todo check if it requires any mandatory attributes or something, don't
    139                  *        remember atm. */
    140                 rc = posix_spawn(&pid, pszExec, NULL, &Attr, (char * const *)papszArgs,
    141                                  (char * const *)papszEnv);
    142                 if (!rc)
    143                 {
    144                     int rc2 = posix_spawnattr_destroy(&Attr); Assert(rc2 == 0); NOREF(rc2);
    145                     if (pProcess)
    146                         *pProcess = pid;
    147                     return VINF_SUCCESS;
    148                 }
    149             }
    150             int rc2 = posix_spawnattr_destroy(&Attr); Assert(rc2 == 0); NOREF(rc2);
     122            if (pProcess)
     123                *pProcess = pid;
     124            return VINF_SUCCESS;
    151125        }
    152126    }
     
    157131        if (!pid)
    158132        {
    159             setpgid(0, 0); /* see comment above */
    160 
    161133            if (fFlags & RTPROC_FLAGS_DAEMONIZE)
    162134            {
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