VirtualBox

Changeset 1016 in kBuild


Ignore:
Timestamp:
Jun 2, 2007 6:58:41 PM (18 years ago)
Author:
bird
Message:

Unix/mac fixes.

File:
1 edited

Legend:

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

    r1008 r1016  
    555555        if (pszStdOut)
    556556        {
     557            int fdReDir;
     558
    557559            close(1);
    558560            fdReDir = open(pszStdOut, O_CREAT | O_TRUNC | O_WRONLY, 0777);
     
    568570        }
    569571
    570         execvp(papszArgv[0], papszArgv);
    571         kObjCacheFatal(pEntry, "%s - execvp failed rc=%d errno=%d %s\n",
    572                        pszMsg, rc, errno, strerror(errno));
     572        execvp(papszArgv[0], (char **)papszArgv);
     573        kObjCacheFatal(pEntry, "%s - execvp failed: %s\n",
     574                       pszMsg, strerror(errno));
    573575    }
    574576    if (pid == -1)
    575577        kObjCacheFatal(pEntry, "%s - fork() failed: %s\n", pszMsg, strerror(errno));
    576578
    577     pidWait = waitpid(pid, &iStatus);
     579    pidWait = waitpid(pid, &iStatus, 0);
    578580    while (pidWait < 0 && errno == EINTR)
    579         pidWait = waitpid(pid, &iStatus);
     581        pidWait = waitpid(pid, &iStatus, 0);
    580582    if (pidWait != pid)
    581583        kObjCacheFatal(pEntry, "%s - waitpid failed rc=%d: %s\n",
     
    644646    if (!pid)
    645647    {
    646         execvp(papszArgv[0], papszArgv);
    647         kObjCacheFatal(pEntry, "%s - execvp failed rc=%d errno=%d %s\n",
    648                        pszMsg, rc, errno, strerror(errno));
     648        execvp(papszArgv[0], (char **)papszArgv);
     649        kObjCacheFatal(pEntry, "%s - execvp failed: %s\n",
     650                       pszMsg, strerror(errno));
    649651    }
    650652    if (pid == -1)
     
    661663     * Read data from the child.
    662664     */
    663     cbAlloc = pEntry->cbOldCpp ? (pEntry->cbOldCpp + 4*1024*1024) & ~(4*1024*1024 - 1) : 4*1024*1024;
     665    cbAlloc = pEntry->cbOldCpp ? (pEntry->cbOldCpp + 4*1024*1024 + 4096) & ~(4*1024*1024 - 1) : 4*1024*1024;
    664666    cbLeft = cbAlloc;
    665667    *ppszOutput = psz = xmalloc(cbAlloc);
    666668    for (;;)
    667669    {
    668         long cbRead = _read(fds[0], psz, cbLeft);
     670        long cbRead = read(fds[0], psz, cbLeft);
    669671        if (!cbRead)
    670672            break;
     
    699701        kObjCacheFatal(pEntry, "%s - failed with rc %d\n", pszMsg, iStatus);
    700702#else
    701     pidWait = waitpid(pid, &iStatus);
     703    pidWait = waitpid(pid, &iStatus, 0);
    702704    while (pidWait < 0 && errno == EINTR)
    703         pidWait = waitpid(pid, &iStatus);
     705        pidWait = waitpid(pid, &iStatus, 0);
    704706    if (pidWait != pid)
    705707        kObjCacheFatal(pEntry, "%s - waitpid failed rc=%d: %s\n",
     
    745747    pEntry->NewSum.crc32 = crc32(0, pEntry->pszNewCppMapping, pEntry->cbNewCpp);
    746748    MD5Init(&MD5Ctx);
    747     MD5Update(&MD5Ctx, pEntry->pszNewCppMapping, pEntry->cbNewCpp);
     749    MD5Update(&MD5Ctx, (unsigned char *)pEntry->pszNewCppMapping, pEntry->cbNewCpp);
    748750    MD5Final(&pEntry->NewSum.md5[0], &MD5Ctx);
    749751    kObjCacheVerbose(pEntry, "crc32=%#lx md5=%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
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