Changeset 1828
- Timestamp:
- Mar 13, 2005, 11:47:21 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/sys/filehandles.c
-
Property cvs2svn:cvs-rev
changed from
1.18
to1.19
r1827 r1828 197 197 for (i = 0; i < c; i++) 198 198 { 199 if (!TCPNAMEG44(AllocFHEx)(iFH, u.pSockets->aHandles[i].usSocket, u.pSockets->aHandles[i].fFlags, 0, NULL)) 199 int rc = TCPNAMEG44(AllocFHEx)(iFH, u.pSockets->aHandles[i].usSocket, u.pSockets->aHandles[i].fFlags, 0, NULL, NULL); 200 if (rc) 200 201 { 201 LIBC_ASSERTM_FAILED("Failed to allocated inherited socket (4.4) handle! iFH=%d iSocket=%d\n",202 iFH, u.pSockets->aHandles[i].usSocket);202 LIBC_ASSERTM_FAILED("Failed to allocated inherited socket (4.4) handle! rc=%d iFH=%d iSocket=%d\n", 203 rc, iFH, u.pSockets->aHandles[i].usSocket); 203 204 __libc_spmInheritRelease(); 204 205 return -1; … … 211 212 for (i = 0; i < c; i++) 212 213 { 213 if (!TCPNAMEG43(AllocFHEx)(iFH, u.pSockets->aHandles[i].usSocket, u.pSockets->aHandles[i].fFlags, 0, NULL)) 214 int rc = TCPNAMEG43(AllocFHEx)(iFH, u.pSockets->aHandles[i].usSocket, u.pSockets->aHandles[i].fFlags, 0, NULL, NULL); 215 if (rc) 214 216 { 215 LIBC_ASSERTM_FAILED("Failed to allocated inherited socket (4.3) handle! iFH=%d iSocket=%d\n",216 iFH, u.pSockets->aHandles[i].usSocket);217 LIBC_ASSERTM_FAILED("Failed to allocated inherited socket (4.3) handle! rc=%d iFH=%d iSocket=%d\n", 218 rc, iFH, u.pSockets->aHandles[i].usSocket); 217 219 __libc_spmInheritRelease(); 218 220 return -1; … … 791 793 { 792 794 /* 793 * If not OS/2 filehandle, we have to make a fakehandle.795 * Send the close call to any non-OS/2 handle. 794 796 */ 795 if (pOps) /** @todo check out the fh duplication with respect to close. */ 796 rc = fhOpenDummy(-1, &fh); 797 797 __LIBC_PFH pFHOld = gpapFHs[fh]; 798 if ( pFHOld 799 && pFHOld->pOps 800 && pFHOld->pOps->pfnClose) 801 rc = pFHOld->pOps->pfnClose(pFHOld, fh); 798 802 if (!rc) 799 803 { 800 804 /* 801 * Free any old filehandle which death we didn't catch 802 * and insert the new one. 805 * If not OS/2 filehandle, make a fake handle. 803 806 */ 804 if (gpapFHs[fh]) 805 fhFreeHandle(gpapFHs[fh]); 806 gpapFHs[fh] = pFH; 807 if (pOps) 808 rc = fhOpenDummy(fh, &fh); 809 if (!rc) 810 { 811 /* 812 * Free any old filehandle (replaced during dup2 or closed outside 813 * this libc) and insert the new one. 814 */ 815 if (pFHOld) 816 fhFreeHandle(pFHOld); 817 gpapFHs[fh] = pFH; 818 } 807 819 } 808 820 } … … 899 911 * were successful or if the handle has become invalid. 900 912 */ 901 if (!rc || rc == ERROR_INVALID_HANDLE || rc == -EBADF) 913 if ( !rc 914 || rc == ERROR_INVALID_HANDLE 915 || rc == -EBADF 916 || rc == -ENOTSOCK) 902 917 { 903 918 int rc2; … … 919 934 * we will free it now. 920 935 */ 921 if (!rc || rc == ERROR_INVALID_HANDLE) 936 if ( !rc2 937 || rc2 == ERROR_INVALID_HANDLE 938 || pFH->pOps) 922 939 { 923 940 gpapFHs[fh] = NULL; … … 1283 1300 if (pFH->pOps && pFH->pOps->pfnForkChild) 1284 1301 { 1285 rc = pFH->pOps->pfnForkChild(pFH, iFH, pForkHandle, __LIBC_FORK_OP_FORK_ PARENT);1302 rc = pFH->pOps->pfnForkChild(pFH, iFH, pForkHandle, __LIBC_FORK_OP_FORK_CHILD); 1286 1303 if (rc) 1287 1304 { -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.