Changeset 1586 for trunk/src/emx
- Timestamp:
- Nov 1, 2004, 3:26:32 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/src/emx/src/lib/sys/tcpipver.c (modified) (8 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/sys/tcpipver.c
-
Property cvs2svn:cvs-rev
changed from
1.4to1.5
r1585 r1586 160 160 static int TCPNAME(imp_send)(int, const void *, int, int); 161 161 static int TCPNAME(imp_removesocketfromlist)(int); 162 162 163 #ifdef TCPV40HDRS 163 164 static int TCPNAME(imp_bsdselect)(int, fd_set *, fd_set *, fd_set *, struct timeval *); … … 228 229 } 229 230 } 230 else if (rc < 0) 231 else if (rc > 0) 232 { 233 /* 234 * Someone is using the socket, we'll remove it from the list of 235 * sockets owned by this process to prevent it from being closed. 236 */ 237 rc = TCPNAME(imp_removesocketfromlist)(pSocketFH->iSocket); 238 if (rc) 239 { 240 LIBC_ASSERTM(!rc, "removesocketfromlist(%d) -> rc=%d sock_errno()->%d\n", pSocketFH->iSocket, rc, TCPNAME(imp_sock_errno)()); 241 rc = -__libc_TcpipGetSocketErrno(); 242 } 243 } 244 else 231 245 rc = -EBADF; 232 246 … … 755 769 LIBCLOG_ENTER("pFH=%p:{iSocket=%d} fh=%d\n", (void *)pFH, ((PLIBCSOCKETFH)pFH)->iSocket, fh); 756 770 PLIBCSOCKETFH pSocketFH = (PLIBCSOCKETFH)pFH; 757 __libc_spmSocketRef(pSocketFH->iSocket); 771 int rc = __libc_spmSocketRef(pSocketFH->iSocket); 772 LIBC_ASSERTM(rc > 0, "__libc_spmSocketDeref(%d) -> rc=%d\n", pSocketFH->iSocket, rc); 758 773 LIBCLOG_RETURN_INT(0); 774 759 775 } 760 776 … … 823 839 824 840 /* 825 * New: Set usage counter to 1 and remove from tcpip cleanup list.826 * Existing: Increment reference counter 841 * New: Set usage counter to 1. 842 * Existing: Increment reference counter 827 843 */ 828 844 if (fNew) 829 845 { 830 __libc_spmSocketNew(iSocket);831 TCPNAME(imp_removesocketfromlist)(iSocket); /* We do our own cleanup! */846 __libc_spmSocketNew(iSocket); 847 832 848 } 833 849 else 834 __libc_spmSocketRef(iSocket); 850 { 851 rc = __libc_spmSocketRef(iSocket); 852 LIBC_ASSERTM(rc > 0, "__libc_spmSocketRef(%d) -> rc=%d\n", iSocket, rc); 853 rc = TCPNAME(imp_addsockettolist)(iSocket); 854 LIBC_ASSERTM(!rc, "addsockettolist(%d) -> rc=%d\n", iSocket, rc); 855 } 835 856 LIBCLOG_RETURN_P(pFH); 836 857 } … … 1094 1115 # define ORD_RECV 10 1095 1116 # define ORD_SEND 13 1117 1096 1118 # define ORD_REMOVESOCKETFROMLIST 28 1097 1119 # define ORD_BSDSELECT 32 … … 1104 1126 # define ORD_RECV 10 1105 1127 # define ORD_SEND 13 1128 1106 1129 # define ORD_REMOVESOCKETFROMLIST 28 1107 1130 # define ORD_BSDSELECT 32 … … 1213 1236 } 1214 1237 1238 1239 1240 1241 1242 1243 1244 1245 1215 1246 static int TCPNAME(imp_removesocketfromlist)(int s) 1216 1247 { … … 1274 1305 if (!rc) 1275 1306 { 1307 1308 1309 1276 1310 rc = TCPNAME(imp_soclose)(pFH->iSocket); 1277 1311 LIBC_ASSERTM(!rc, "soclose(%d) -> rc=%d sock_errno()->%d\n", pFH->iSocket, rc, TCPNAME(imp_sock_errno)()); 1312 1313 1314 1315 1316 1317 1318 1319 1320 1278 1321 } 1279 1322 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
