Changeset 1914 for trunk/src


Ignore:
Timestamp:
Dec 1, 1999, 11:47:51 AM (26 years ago)
Author:
sandervl
Message:

max open files fix + EB's mmap fix

Location:
trunk/src/kernel32
Files:
2 edited

Legend:

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

    r1432 r1914  
    1 /* $Id: hmmmap.cpp,v 1.7 1999-10-24 22:51:21 sandervl Exp $ */
     1/* $Id: hmmmap.cpp,v 1.8 1999-12-01 10:47:51 sandervl Exp $ */
    22
    33/*
     
    6060     protect & ~(PAGE_READONLY|PAGE_READWRITE|PAGE_WRITECOPY|SEC_COMMIT|SEC_IMAGE|SEC_RESERVE|SEC_NOCACHE) ||
    6161     (protect & (PAGE_READONLY|PAGE_READWRITE|PAGE_WRITECOPY)) == 0 ||
    62      (hFile == -1 && (protect & SEC_COMMIT)) ||
     62//     (hFile == -1 && (protect & SEC_COMMIT)) ||
    6363     ((protect & SEC_COMMIT) && (protect & SEC_RESERVE)))
    6464  {
  • trunk/src/kernel32/oslibdos.cpp

    r1844 r1914  
    1 /* $Id: oslibdos.cpp,v 1.10 1999-11-26 00:05:18 sandervl Exp $ */
     1/* $Id: oslibdos.cpp,v 1.11 1999-12-01 10:47:51 sandervl Exp $ */
    22
    33/*
     
    1414#define INCL_DOSMEMMGR
    1515#define INCL_DOSPROCESS
     16#define INCL_DOSERRORS
    1617#include <os2wrap.h>                     //Odin32 OS/2 api wrappers
    1718#include <stdlib.h>
     
    200201        os2flags |= OPEN_SHARE_DENYWRITE;
    201202
     203tryopen:
    202204  rc = DosOpen(lpszFileName,                     /* File path name */
    203205               &hFile,                   /* File handle */
     
    211213
    212214  if(rc) {
     215        if(rc == ERROR_TOO_MANY_OPEN_FILES) {
     216         ULONG CurMaxFH;
     217         LONG  ReqCount = 32;
     218
     219                rc = DosSetRelMaxFH(&ReqCount, &CurMaxFH);
     220                if(rc) {
     221                        dprintf(("DosSetRelMaxFH returned %d", rc));
     222                        return 0;
     223                }
     224                dprintf(("DosOpen failed -> increased nr open files to %d", CurMaxFH));
     225                goto tryopen;
     226        }
    213227        return 0;
    214228  }
     
    529543//******************************************************************************
    530544//******************************************************************************
     545void OSLibDosDisableHardError(BOOL fTurnOff)
     546{
     547  DosError((fTurnOff) ? FERR_DISABLEHARDERR : FERR_ENABLEHARDERR);
     548}
     549//******************************************************************************
     550//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.