Changeset 1172
- Timestamp:
- Feb 4, 2004, 11:36:47 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/libsocket/bsdselect.c
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r1171 r1172 71 71 #ifdef TCPV40HDRS 72 72 /* here we need to figure out the max real socket handle */ 73 int iMax = *pcFDs - 1;74 for (iMax = 0, i = 0; i < c; i++)73 int iMax; 74 for (iMax = *pcFDs - 1, i = 0; i < c; i++) 75 75 if (FD_ISSET(i, pFrom)) 76 76 { … … 101 101 * @param pTo The structure we present to OS/2 TCPIP. 102 102 * This will be initialized. 103 */ 104 static inline int convert(int c, int cb, const struct fd_set *pFrom, struct my_fd_set *pTo) 103 * @param pszType Typestring to use in the log. 104 */ 105 static inline int convert(int c, int cb, const struct fd_set *pFrom, struct my_fd_set *pTo, const char *pszType) 105 106 { 106 107 int i; … … 112 113 PLIBCSOCKETFH pFHSocket = __libsocket_FH(i); 113 114 if (!pFHSocket) 115 { 116 LIBCLOG_MSG2("Invalid handle %d specified (%s).\n", i, pszType); 114 117 return -1; 118 } 115 119 MY_FD_SET(pFHSocket->iSocket, pTo); 116 } 117 } 120 LIBCLOG_MSG2("%s: %02d -> %03d\n", pszType, i, pFHSocket->iSocket); 121 } 122 } 123 pszType = pszType; 118 124 return 0; 119 125 } … … 126 132 * @param pTo The structure passed in to select which have to 127 133 * be updated for the return. 128 */ 129 static inline void update(int c, const struct my_fd_set *pFrom, struct fd_set *pTo) 134 * @param pszType Typestring to use in the log. 135 */ 136 static inline void update(int c, const struct my_fd_set *pFrom, struct fd_set *pTo, const char *pszType) 130 137 { 131 138 int i; … … 138 145 { 139 146 if (!MY_FD_ISSET(pFHSocket->iSocket, pFrom)) 147 { 140 148 FD_CLR(i, pTo); 149 LIBCLOG_MSG2("%s: %02d -> %03d set\n", pszType, i, pFHSocket->iSocket); 150 } 151 else 152 LIBCLOG_MSG2("%s: %02d -> %03d clear\n", pszType, i, pFHSocket->iSocket); 141 153 } 142 154 } 143 155 } 156 pszType = pszType; 144 157 } 145 158 … … 222 235 if (readfds) 223 236 { 224 if (convert(nfds, cb, readfds, pRead ))225 LIBCLOG_RETURN_INT(-1); 226 } 227 228 if (writefds) 229 { 230 if (convert(nfds, cb, writefds, pWrite ))231 LIBCLOG_RETURN_INT(-1); 232 } 233 234 if (exceptfds) 235 { 236 if (convert(nfds, cb, exceptfds, pExcept ))237 if (convert(nfds, cb, readfds, pRead, "read ")) 238 LIBCLOG_RETURN_INT(-1); 239 } 240 241 if (writefds) 242 { 243 if (convert(nfds, cb, writefds, pWrite, "write")) 244 LIBCLOG_RETURN_INT(-1); 245 } 246 247 if (exceptfds) 248 { 249 if (convert(nfds, cb, exceptfds, pExcept, "excpt")) 237 250 LIBCLOG_RETURN_INT(-1); 238 251 } … … 241 254 * Do the call. 242 255 */ 256 LIBCLOG_MSG("calling native: cFDs=%d pRead=%p pWrite=%p, pExcept=%p tv=%p\n", 257 cFDs, pRead, pWrite, pExcept, tv); 243 258 rc = __libsocket_bsdselect(cFDs, pRead, pWrite, pExcept, tv); 244 259 if (rc < 0) … … 268 283 */ 269 284 if (readfds) 270 update(nfds, pRead, readfds );271 if (writefds) 272 update(nfds, pWrite, writefds );273 if (exceptfds) 274 update(nfds, pExcept, exceptfds );285 update(nfds, pRead, readfds, "read "); 286 if (writefds) 287 update(nfds, pWrite, writefds, "write"); 288 if (exceptfds) 289 update(nfds, pExcept, exceptfds, "excpt"); 275 290 276 291 LIBCLOG_RETURN_INT(rc); -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.