diff --git a/mozilla/xpcom/io/nsLocalFileOS2.cpp b/mozilla/xpcom/io/nsLocalFileOS2.cpp index b7bc7ec0a28..e378a88d2de 100644 --- a/mozilla/xpcom/io/nsLocalFileOS2.cpp +++ b/mozilla/xpcom/io/nsLocalFileOS2.cpp @@ -916,7 +916,19 @@ nsLocalFile::CopySingleFile(nsIFile *sourceFile, nsIFile *destParent, const nsAC * same drive. "MoveFile()" on Windows will go ahead and move the * file without error, so we need to do the same IBM-AKR */ - rc = DosCopy(filePath.get(), (PSZ)NS_CONST_CAST(char*, destPath.get()), DCPY_EXISTING); + do { + rc = DosCopy(filePath.get(), (PSZ)NS_CONST_CAST(char*, destPath.get()), DCPY_EXISTING); + if (rc == ERROR_TOO_MANY_OPEN_FILES) { + ULONG CurMaxFH = 0; + LONG ReqCount = 20; + APIRET rc2; + rc2 = DosSetRelMaxFH(&ReqCount, &CurMaxFH); + if (rc2 != NO_ERROR) { + break; + } + } + } while (rc == ERROR_TOO_MANY_OPEN_FILES); + /* WSOD2 HACK */ if (rc == 65) { // NETWORK_ACCESS_DENIED CHAR achProgram[CCHMAXPATH]; // buffer for program name, parameters @@ -1489,7 +1501,7 @@ nsLocalFile::SetFileSize(PRInt64 aFileSize) OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, OPEN_SHARE_DENYREADWRITE | OPEN_ACCESS_READWRITE, NULL); - + if (rc != NO_ERROR) { MakeDirty(); diff --git a/mozilla/xpcom/threads/plevent.h b/mozilla/xpcom/threads/plevent.h index 22fe63588df..70fd43363b2 100644 --- a/mozilla/xpcom/threads/plevent.h +++ b/mozilla/xpcom/threads/plevent.h @@ -180,6 +180,7 @@ and to ensure that no more events will be delivered for that owner. #elif defined(XP_OS2) #define INCL_DOSMISC #define INCL_DOSPROCESS +#define INCL_DOSERRORS #include #endif diff --git a/mozilla/xpfe/bootstrap/nsAppRunner.cpp b/mozilla/xpfe/bootstrap/nsAppRunner.cpp index 01a951324e4..5f175efc5d7 100644 --- a/mozilla/xpfe/bootstrap/nsAppRunner.cpp +++ b/mozilla/xpfe/bootstrap/nsAppRunner.cpp @@ -36,6 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ + #include "nsIServiceManager.h" #include "nsIComponentManager.h" #include "nsIGenericFactory.h" @@ -1768,6 +1769,17 @@ int main(int argc, char* argv[]) #if defined(XP_OS2) __argc = argc; __argv = argv; + + ULONG ulMaxFH = 0; + LONG ulReqCount = 0; + APIRET rc = NO_ERROR; + + DosSetRelMaxFH(&ulReqCount, + &ulMaxFH); + + if (ulMaxFH < 256) { + DosSetMaxFH(256); + } #endif /* XP_OS2 */ #if defined(XP_BEOS)