The Samba-Bugzilla – Attachment 781 Details for
Bug 2050
sys_select() used with a fixed first argument
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Calculate max fd while opening fds and use it as first art to sys_select()
smbd-server.c.diff (text/plain), 898 bytes, created by
Lars Müller
on 2004-11-17 12:24:33 UTC
(
hide
)
Description:
Calculate max fd while opening fds and use it as first art to sys_select()
Filename:
MIME Type:
Creator:
Lars Müller
Created:
2004-11-17 12:24:33 UTC
Size:
898 bytes
patch
obsolete
>Author: Lars Mueller <lmuelle at SuSE dot de> >Subject: Precise usage of the max fd argument to select() >Bugzilla: bugzilla.Samba.org #2050 > >--- samba-3.0.8/source/smbd/server.c >+++ samba-3.0.8/source/smbd/server.c 2004-11-15 15:48:41 >@@ -186,6 +186,7 @@ > int fd_listenset[FD_SETSIZE]; > fd_set listen_set; > int s; >+ int max_fd = 0; > int i; > char *ports; > >@@ -245,6 +246,8 @@ > s = fd_listenset[num_sockets] = open_socket_in(SOCK_STREAM, port, 0, ifip->s_addr, True); > if(s == -1) > return False; >+ if (max_fd < s) >+ max_fd = s; > > /* ready to listen */ > set_socket_options(s,"SO_KEEPALIVE"); >@@ -335,7 +338,7 @@ > memcpy((char *)&lfds, (char *)&listen_set, > sizeof(listen_set)); > >- num = sys_select(FD_SETSIZE,&lfds,NULL,NULL,NULL); >+ num = sys_select(max_fd+1,&lfds,NULL,NULL,NULL); > > if (num == -1 && errno == EINTR) { > if (got_sig_term) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 2050
:
781
|
795
|
796