VirtualBox

Changeset 2932 in kBuild for trunk/src/kWorker/kWorker.c


Ignore:
Timestamp:
Sep 18, 2016 4:20:11 PM (8 years ago)
Author:
bird
Message:

kWorker.c: Don't call kwSandboxGrowEnv unless it's necessary. Duh.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kWorker/kWorker.c

    r2928 r2932  
    31243124        cNew += 256;
    31253125
    3126 
    31273126    pvNew = kHlpRealloc(pSandbox->environ, cNew * sizeof(pSandbox->environ[0]));
    31283127    if (pvNew)
     
    40934092        {
    40944093            //static int s_cDbgGets = 0;
    4095             KU32 cchProc = kHlpStrLen(pszProc);
     4094            KU32 cchProc = (KU32)kHlpStrLen(pszProc);
    40964095            KU32 i = g_cSandboxGetProcReplacements;
    40974096            while (i-- > 0)
     
    78467845    KSIZE cbCmdLine;
    78477846    KU32 i;
    7848     int rc;
    78497847
    78507848    /* Simple stuff. */
     
    79047902
    79057903    /*
    7906      * Setup the enviornment.
     7904     * Setup the environment.
    79077905     */
    7908     rc = kwSandboxGrowEnv(pSandbox, cEnvVars + 2);
    7909     if (rc == 0)
     7906    if (   cEnvVars + 2 <= pSandbox->cEnvVarsAllocated
     7907        || kwSandboxGrowEnv(pSandbox, cEnvVars + 2) == 0)
    79107908    {
    79117909        KU32 iDst = 0;
     
    79437941    }
    79447942    else
    7945         return kwErrPrintfRc(KERR_NO_MEMORY, "Error setting up environment variables: %d\n", rc);
     7943        return kwErrPrintfRc(KERR_NO_MEMORY, "Error setting up environment variables: kwSandboxGrowEnv failed\n");
    79467944
    79477945    /*
     
    83358333 * @param   fWatcomBrainDamange Whether to apply watcom rules while quoting.
    83368334 * @param   cEnvVars            The number of environment variables.
    8337  * @param   papszEnvVars        The enviornment vector.
     8335 * @param   papszEnvVars        The environment vector.
    83388336 * @param   cPostCmdArgs        Number of post command arguments (includes cmd).
    83398337 * @param   papszPostCmdArgs    The post command and its argument.
     
    90969094 * with the kRedirect command, but not the file redirection.  So long no file
    90979095 * operation is involed, kSubmit is a drop in kRedirect replacement.  This is
    9098  * hand for tools like OpenWatcom, NASM and YASM which all require enviornment
     9096 * hand for tools like OpenWatcom, NASM and YASM which all require environment
    90999097 * and/or current directory changes to work.
    91009098 *
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