Changeset 591 for vendor/current/source3/lib
- Timestamp:
- Jul 1, 2011, 9:17:44 AM (14 years ago)
- Location:
- vendor/current/source3/lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/lib/events.c
r427 r591 56 56 57 57 for (fde = ev->fd_events; fde; fde = fde->next) { 58 if (fde->fd < 0 || fde->fd >= FD_SETSIZE) { 59 /* We ignore here, as it shouldn't be 60 possible to add an invalid fde->fd 61 but we don't want FD_SET to see an 62 invalid fd. */ 63 continue; 64 } 65 58 66 if (fde->flags & EVENT_FD_READ) { 59 67 FD_SET(fde->fd, read_fds); -
vendor/current/source3/lib/g_lock.c
r453 r591 392 392 FD_ZERO(r_fds); 393 393 max_fd = ctdbd_conn_get_fd(conn); 394 FD_SET(max_fd, r_fds); 394 if (max_fd >= 0 && max_fd < FD_SETSIZE) { 395 FD_SET(max_fd, r_fds); 396 } 395 397 } 396 398 #endif -
vendor/current/source3/lib/packet.c
r414 r591 108 108 fd_set r_fds; 109 109 110 if (ctx->fd < 0 || ctx->fd >= FD_SETSIZE) { 111 errno = EBADF; 112 return map_nt_error_from_unix(errno); 113 } 114 110 115 FD_ZERO(&r_fds); 111 116 FD_SET(ctx->fd, &r_fds); -
vendor/current/source3/lib/readline.c
r414 r591 92 92 timeout.tv_usec = 0; 93 93 94 if (fd < 0 || fd >= FD_SETSIZE) { 95 errno = EBADF; 96 break; 97 } 98 94 99 FD_ZERO(&fds); 95 100 FD_SET(fd,&fds); -
vendor/current/source3/lib/select.c
r414 r591 76 76 } 77 77 78 if (select_pipe[0] < 0 || select_pipe[0] >= FD_SETSIZE) { 79 DEBUG(0, ("sys_select: bad fd\n")); 80 if (readfds != NULL) 81 FD_ZERO(readfds); 82 if (writefds != NULL) 83 FD_ZERO(writefds); 84 if (errorfds != NULL) 85 FD_ZERO(errorfds); 86 errno = EBADF; 87 return -1; 88 } 78 89 /* 79 90 * These next two lines seem to fix a bug with the Linux … … 102 113 FD_ZERO(readfds2); 103 114 } 115 104 116 FD_SET(select_pipe[0], readfds2); 105 117 -
vendor/current/source3/lib/util_sock.c
r414 r591 496 496 497 497 for (nread=0; nread < mincnt; ) { 498 if (fd < 0 || fd >= FD_SETSIZE) { 499 errno = EBADF; 500 return map_nt_error_from_unix(EBADF); 501 } 502 498 503 FD_ZERO(&fds); 499 504 FD_SET(fd,&fds); … … 1236 1241 for (i=0; i<num_addrs; i++) { 1237 1242 sockets[i] = socket(addrs[i].ss_family, SOCK_STREAM, 0); 1238 if (sockets[i] < 0 )1243 if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE) 1239 1244 goto done; 1240 1245 set_blocking(sockets[i], false); … … 1285 1290 1286 1291 for (i=0; i<num_addrs; i++) { 1287 if (sockets[i] == -1) 1292 if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE) { 1293 /* This cannot happen - ignore if so. */ 1288 1294 continue; 1295 } 1289 1296 FD_SET(sockets[i], &wr_fds); 1290 1297 FD_SET(sockets[i], &r_fds); … … 1306 1313 for (i=0; i<num_addrs; i++) { 1307 1314 1308 if (sockets[i] == -1) 1315 if (sockets[i] < 0 || sockets[i] >= FD_SETSIZE) { 1316 /* This cannot happen - ignore if so. */ 1309 1317 continue; 1318 } 1310 1319 1311 1320 /* Stevens, Network Programming says that if there's a
Note:
See TracChangeset
for help on using the changeset viewer.