Changeset 578 for branches/samba-3.3.x/source/smbd/server.c
- Timestamp:
- Jun 25, 2011, 7:14:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/smbd/server.c
r423 r578 210 210 /* We will abort gracefully when the client or remote system 211 211 goes away */ 212 smbd_set_server_fd(dup(0)); 212 int fd = dup(0); 213 214 if (fd < 0 || fd >= FD_SETSIZE) { 215 return false; 216 } 217 218 smbd_set_server_fd(fd); 213 219 214 220 /* close our standard file descriptors */ … … 437 443 ifss, 438 444 true); 439 if(s == -1) { 445 if(s < 0 || s >= FD_SETSIZE) { 446 close(s); 440 447 continue; 441 448 } … … 517 524 &ss, 518 525 true); 519 if (s == -1) {526 if (s < 0 || s >= FD_SETSIZE) { 520 527 continue; 521 528 } … … 710 717 socklen_t in_addrlen = sizeof(addr); 711 718 pid_t child = 0; 719 int fd; 712 720 713 721 s = -1; … … 722 730 } 723 731 724 smbd_set_server_fd(accept(s,&addr,&in_addrlen)); 725 726 if (smbd_server_fd() == -1 && errno == EINTR) 732 fd = accept(s,&addr,&in_addrlen); 733 if (fd == -1 && errno == EINTR) 727 734 continue; 728 729 if (smbd_server_fd() == -1) { 735 if (fd == -1) { 730 736 DEBUG(2,("open_sockets_smbd: accept: %s\n", 731 737 strerror(errno))); 732 738 continue; 733 739 } 740 if (fd < 0 || fd >= FD_SETSIZE) { 741 DEBUG(2,("open_sockets_smbd: bad fd %d\n", 742 fd )); 743 continue; 744 } 745 746 smbd_set_server_fd(fd); 734 747 735 748 /* Ensure child is set to blocking mode */
Note:
See TracChangeset
for help on using the changeset viewer.