Changeset 2943


Ignore:
Timestamp:
Jan 8, 2007, 10:09:25 AM (19 years ago)
Author:
bird
Message:

fixed some i/o bugs.

Location:
trunk/libc/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libc/src/kNIX/filehandles.c

    r2929 r2943  
    583583
    584584    /*
     585     * If it's a request for a native handle, grant it without further ado.
     586     */
     587    /** @todo need a better way of flagging that it's a native pOps. */
     588    if (fh != -1 && pFH->pOps->enmType == enmFH_File)
     589    {
     590        pFH->fh = fh;
     591        return 0;
     592    }
     593
     594    /*
    585595     * Open the NUL device.
    586596     * If we're out of handle space, try increase it.
     
    10801090         */
    10811091        FS_VAR_SAVE_LOAD();
    1082         rc2 = DosClose(pFH->fh);
     1092        int rc2 = DosClose(pFH->fh); (void)rc2;
    10831093        FS_RESTORE();
    10841094        LIBC_ASSERTM(!rc2, "DosClose(%d) -> rc2=%d (rc=%d)\n", pFH->fh, rc2, rc);
     
    13601370    FS_VAR_SAVE_LOAD();
    13611371    ULONG fulState;
    1362     int rc = DosQueryFHState(fh, &fulState);
     1372    int rc = DosQueryFHState(pFH->fh, &fulState);
    13631373    if (!rc)
    13641374    {
     
    13681378                           == (O_NOINHERIT | (FD_CLOEXEC << __LIBC_FH_FDFLAGS_SHIFT)) ),
    13691379                     "Inherit flags are out of sync for file hFile %d (%#x)! fulState=%08lx fFlags=%08x\n",
    1370                      fh, fh, fulState, pFH->fFlags);
     1380                     pFH->fh, pFH->fh, fulState, pFH->fFlags);
    13711381        if (fFlags & (FD_CLOEXEC << __LIBC_FH_FDFLAGS_SHIFT))
    13721382            fulNewState = fulState | OPEN_FLAGS_NOINHERIT;
     
    13761386        {
    13771387            fulNewState &= OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT; /* Turn off non-participating bits. */
    1378             rc = DosSetFHState(fh, fulNewState);
     1388            rc = DosSetFHState(pFH->fh, fulNewState);
    13791389        }
    13801390    }
  • trunk/libc/src/kNIX/os2/kNIXConfig.h

    r2929 r2943  
    1 /* $Id: $ */
     1/* $Id$ */
    22/** @file
    33 *
     
    3333 * selves during allcation.
    3434 */
    35 #define CFG_KNIX_FH_NATIVE_ALLOCATION  0
     35#define CFG_KNIX_FH_NATIVE_ALLOCATION  1
    3636/** Maximum number of file handles. */
    3737#define CFG_KNIX_MAX_FHS                10000
  • trunk/libc/src/libc/io/read.c

    r2739 r2943  
    105105    int la;
    106106    size_t i = 0;
    107     char *pbDst = (char *)pbDst;
     107    char *pbDst = (char *)pvBuf;
    108108    if (    cbToRead > 0
    109109        &&  (la = __lxchg(&pFH->iLookAhead, -1)) != -1)
Note: See TracChangeset for help on using the changeset viewer.