Ignore:
Timestamp:
Nov 29, 2001, 12:33:37 AM (24 years ago)
Author:
phaller
Message:

Fixes in HandleManager and Device Handlers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/oslibdos.cpp

    r7398 r7474  
    1 /* $Id: oslibdos.cpp,v 1.85 2001-11-19 13:02:58 phaller Exp $ */
     1/* $Id: oslibdos.cpp,v 1.86 2001-11-28 23:33:37 phaller Exp $ */
    22/*
    33 * Wrappers for OS/2 Dos* API
     
    178178    case ERROR_WRITE_PROTECT: //19
    179179        return ERROR_WRITE_PROTECT_W;
     180 
     181    case ERROR_BAD_UNIT: //20
     182        return ERROR_BAD_UNIT_W;
    180183
    181184    case ERROR_NOT_READY: //21
     
    604607               os2flags,
    605608               0L);                            /* No extended attribute */
    606 
    607   if(rc) {
    608         if(rc == ERROR_TOO_MANY_OPEN_FILES) {
    609          ULONG CurMaxFH;
    610          LONG  ReqCount = 32;
    611 
    612                 rc = DosSetRelMaxFH(&ReqCount, &CurMaxFH);
    613                 if(rc) {
    614                         dprintf(("DosSetRelMaxFH returned %d", rc));
    615                         return 0;
    616                 }
    617                 dprintf(("DosOpen failed -> increased nr open files to %d", CurMaxFH));
    618                 goto tryopen;
    619         }
     609  if(rc)
     610  {
     611    if(rc == ERROR_TOO_MANY_OPEN_FILES)
     612    {
     613      ULONG CurMaxFH;
     614      LONG  ReqCount = 32;
     615
     616      rc = DosSetRelMaxFH(&ReqCount, &CurMaxFH);
     617      if(rc)
     618      {
     619        dprintf(("DosSetRelMaxFH returned %d", rc));
    620620        return 0;
    621   }
    622   else  return hFile;
     621      }
     622      dprintf(("DosOpen failed -> increased nr open files to %d", CurMaxFH));
     623      goto tryopen;
     624    }
     625   
     626    SetLastError(error2WinError(rc));
     627    return 0;
     628  }
     629 
     630  // OK, file was opened
     631  SetLastError(ERROR_SUCCESS_W);
     632  return hFile;
    623633}
    624634//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.