Changeset 1367
- Timestamp:
- Apr 15, 2004, 12:51:47 AM (21 years ago)
- Location:
- trunk/src/emx/src/lib/sys
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/sys/__dup.c
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r1366 r1367 4 4 #include "libc-alias.h" 5 5 #define INCL_FSMACROS 6 #define INCL_ERRORS 6 7 #include <os2emx.h> 7 8 #include <errno.h> … … 31 32 if (!pFH->pOps) 32 33 { 33 HFILE hNew = ~0; 34 int cExpandRetries; 35 HFILE hNew; 34 36 FS_VAR(); 35 37 FS_SAVE_LOAD(); 36 rc = DosDupHandle(fh, &hNew); 38 for (cExpandRetries = 0;;) 39 { 40 hNew = ~0; 41 rc = DosDupHandle(fh, &hNew); 42 if (rc != ERROR_TOO_MANY_OPEN_FILES) 43 break; 44 if (cExpandRetries++ >= 3) 45 break; 46 /* autoincrement. */ 47 __libc_FHMoreHandles(); 48 } /* ... retry 3 times ... */ 37 49 FS_RESTORE(); 38 50 fhNew = (int)hNew; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__open.c
-
Property cvs2svn:cvs-rev
changed from
1.9
to1.10
r1366 r1367 34 34 HFILE hFile; 35 35 int cch; 36 int cExpandRetries; 36 37 int failed_open_errno; 37 38 FS_VAR(); … … 114 115 */ 115 116 FS_SAVE_LOAD(); 117 for (cExpandRetries = 0;;) 118 { 116 119 #if OFF_MAX > LONG_MAX 117 if (__pfnDosOpenL) 118 { 119 LONGLONG cbInitialTmp = cbInitial; 120 int cch = strlen(pszFile); 121 char * pszFile_safe = alloca(cch + 1); 122 if (pszFile_safe) 123 { 124 strcpy(pszFile_safe, pszFile); 125 rc = __pfnDosOpenL((PCSZ)pszFile_safe, &hFile, &ulAction, cbInitialTmp, flAttr, flOpenFlags, flOpenMode, NULL); 120 if (__pfnDosOpenL) 121 { 122 LONGLONG cbInitialTmp = cbInitial; 123 int cch = strlen(pszFile); 124 char * pszFile_safe = alloca(cch + 1); 125 if (pszFile_safe) 126 { 127 strcpy(pszFile_safe, pszFile); 128 rc = __pfnDosOpenL((PCSZ)pszFile_safe, &hFile, &ulAction, cbInitialTmp, flAttr, flOpenFlags, flOpenMode, NULL); 129 } 130 else 131 rc = ERROR_NOT_ENOUGH_MEMORY; 126 132 } 127 133 else 128 rc = ERROR_NOT_ENOUGH_MEMORY; 129 } 130 else 131 { 132 ULONG cbInitialTmp = (ULONG)cbInitial; 133 if (cbInitial > LONG_MAX) 134 { 135 FS_RESTORE(); 136 errno = EOVERFLOW; 137 LIBCLOG_RETURN_INT(-1); 138 } 139 rc = DosOpen((PCSZ)pszFile, &hFile, &ulAction, cbInitialTmp, flAttr, flOpenFlags, flOpenMode, NULL); 140 } 134 { 135 ULONG cbInitialTmp = (ULONG)cbInitial; 136 if (cbInitial > LONG_MAX) 137 { 138 FS_RESTORE(); 139 errno = EOVERFLOW; 140 LIBCLOG_RETURN_INT(-1); 141 } 142 rc = DosOpen((PCSZ)pszFile, &hFile, &ulAction, cbInitialTmp, flAttr, flOpenFlags, flOpenMode, NULL); 143 } 141 144 #else 142 {143 ULONG cbInitialTmp = cbInitial;144 rc = DosOpen((PCSZ)pszFile, &hFile, &ulAction, cbInitialTmp, flAttr, flOpenFlags, flOpenMode, NULL);145 }145 { 146 ULONG cbInitialTmp = cbInitial; 147 rc = DosOpen((PCSZ)pszFile, &hFile, &ulAction, cbInitialTmp, flAttr, flOpenFlags, flOpenMode, NULL); 148 } 146 149 #endif 150 /* Check if we're out of handles. */ 151 if (rc != ERROR_TOO_MANY_OPEN_FILES) 152 break; 153 if (cExpandRetries++ >= 3) 154 break; 155 __libc_FHMoreHandles(); 156 } /* ... retry 3 times ... */ 147 157 148 158 if (!rc) -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/src/lib/sys/__pipe.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r1366 r1367 3 3 4 4 #include "libc-alias.h" 5 #define INCL_ERRORS 5 6 #define INCL_DOSQUEUES 6 7 #define INCL_FSMACROS … … 14 15 int __pipe(int *two_handles, int pipe_size, PLIBCFH *ppFHRead, PLIBCFH *ppFHWrite) 15 16 { 16 ULONG rc; 17 ULONG rc; 18 int cExpandRetries; 17 19 FS_VAR(); 18 20 19 FS_SAVE_LOAD();20 21 /* 21 22 * Create the pipe 22 23 */ 23 rc = DosCreatePipe((PHFILE)&two_handles[0], (PHFILE)&two_handles[1], pipe_size); 24 FS_SAVE_LOAD(); 25 for (cExpandRetries = 0;;) 26 { 27 rc = DosCreatePipe((PHFILE)&two_handles[0], (PHFILE)&two_handles[1], pipe_size); 28 if (rc != ERROR_TOO_MANY_OPEN_FILES) 29 break; 30 if (cExpandRetries++ >= 3) 31 break; 32 /* auto increment */ 33 __libc_FHMoreHandles(); 34 } /* ... retry 3 times ... */ 35 24 36 if (!rc) 25 37 { -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.