- Timestamp:
- May 27, 2007, 12:37:44 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/src/kNIX/os2/tcpipver.c
r2929 r3372 155 155 156 156 static void TCPNAME(Cleanup)(void); 157 static int tcpipForkChild1(__LIBC_PFORKHANDLE pForkHandle, __LIBC_FORKOP enmOperation);158 157 159 158 … … 227 226 __libc_spmSocketRef(pSocketFH->iSocket); 228 227 } 228 /** @todo deal with EALREADY, it will leave an unclosed and soon to be invalid handle behind... */ 229 229 } 230 230 } … … 241 241 * Please note that removesocketfromlist returns a boolean success indicator and proably no errno. 242 242 */ 243 int iSavedTcpipErrno = TCPNAME(imp_sock_errno)(); 244 TCPNAME(imp_set_errno)(0); 243 245 rc = TCPNAME(imp_removesocketfromlist)(pSocketFH->iSocket); 244 246 if (!rc) … … 247 249 rc = -EBADF; /* this is an internal error, it should *NOT* happen! */ 248 250 } 251 else 252 rc = 0; 253 TCPNAME(imp_set_errno)(iSavedTcpipErrno); 249 254 } 250 255 251 256 /* 252 * Unlink from our list .257 * Unlink from our list (rc list must correspond to __libc_FHClose!). 253 258 */ 254 if (rc != -EBADF && rc != -ENOTSOCK && rc != -EALREADY) 255 { 259 if ( !rc 260 || rc == -EBADF 261 || rc == -ENOTSOCK) 262 { 263 LIBCLOG_MSG("Unlinking pSocketFH=%p:{iSocket=%d} fh=%d\n", pSocketFH, pSocketFH->iSocket, fh); 256 264 _smutex_request(&gsmtxSockets); 257 265 if (pSocketFH->pNext) … … 856 864 * list for the current process. 857 865 * If clear we only increment the global reference counter. 858 * @param pfh Where to store the file name.866 * @param pfh Where to store the file handle. 859 867 * @param ppFHSocket Where to store the allocated socket handle. Optional. 860 868 */ 861 869 int TCPNAMEG(AllocFHEx)(int fh, int iSocket, unsigned fFlags, int fNew, int *pfh, PLIBCSOCKETFH *ppFHSocket) 862 870 { 863 LIBCLOG_ENTER(" iSocket=%d\n", iSocket);871 LIBCLOG_ENTER("fh=%d iSocket=%d fFlags=%#x fNew=%d pfh=%p:{%d} ppFHSocket=%p\n", fh, iSocket, fFlags, fNew, (void *)pfh, pfh ? *pfh : -2, (void *)ppFHSocket); 864 872 __LIBC_PFH pFHLibc; 865 873 int rc = __libc_FHAllocate(sizeof(LIBCSOCKETFH), &gSocketOps, iSocket, fh, fFlags, &pFHLibc); … … 906 914 else 907 915 __libc_FHPut(pFHLibc); 908 LIBCLOG_RETURN_ INT(0);916 LIBCLOG_RETURN_MSG(0, "ret 0 *pfh=%d *ppFHSocket=%p\n", pfh ? *pfh : -2, pFH); 909 917 } 910 918 LIBCLOG_ERROR_RETURN_P(rc); … … 1212 1220 HMODULE hmod; 1213 1221 char szErr[16]; 1214 rc = DosLoadModule ((PSZ)szErr, sizeof(szErr), (PCSZ)gszDllName, &hmod);1222 rc = DosLoadModuleEx((PSZ)szErr, sizeof(szErr), (PCSZ)gszDllName, &hmod); 1215 1223 if (rc) 1216 1224 { … … 1388 1396 * Please note that removesocketfromlist is returning a boolean success indicator and probably no errno. 1389 1397 */ 1398 TCPNAME(imp_set_errno)(0); 1390 1399 rc = TCPNAME(imp_removesocketfromlist)(pFH->iSocket); 1391 1400 LIBC_ASSERTM(rc == 1, "removesocketfromlist(%d) -> rc=%d sock_errno()->%d\n", pFH->iSocket, rc, TCPNAME(imp_sock_errno)()); … … 1398 1407 } 1399 1408 1400 1401 #undef __LIBC_LOG_GROUP1402 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_FORK1403 1404 _FORK_CHILD1(0xffffff00, tcpipForkChild1)1405 1406 /**1407 * Reload the DLL in the child process.1408 *1409 * @returns 0 on success.1410 * @returns negative errno on failure.1411 * @param pForkHandle Pointer to fork handle.1412 * @param enmOperation Callback operation.1413 */1414 static int tcpipForkChild1(__LIBC_PFORKHANDLE pForkHandle, __LIBC_FORKOP enmOperation)1415 {1416 LIBCLOG_ENTER("pForkHandle=%p enmOperation=%d\n", (void *)pForkHandle, enmOperation);1417 int rc;1418 switch (enmOperation)1419 {1420 case __LIBC_FORK_OP_FORK_CHILD:1421 {1422 rc = 0;1423 if (ghmod)1424 rc = __libc_tcpipForkLoadModule(ghmod, gszDllName);1425 break;1426 }1427 1428 default:1429 rc = 0;1430 break;1431 }1432 1433 LIBCLOG_RETURN_INT(rc);1434 }1435 1436
Note:
See TracChangeset
for help on using the changeset viewer.