The Samba-Bugzilla – Attachment 1605 Details for
Bug 3271
Rsync instances stay in memory when using in daemon mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
avoids select() call when possible
hanging_fix4.patch (text/plain), 1.99 KB, created by
James Ranson
on 2005-12-02 22:35:57 UTC
(
hide
)
Description:
avoids select() call when possible
Filename:
MIME Type:
Creator:
James Ranson
Created:
2005-12-02 22:35:57 UTC
Size:
1.99 KB
patch
obsolete
>diff -C5 rsync-2.6.0/io.c rsync-2.6.0-patched/io.c >*** rsync-2.6.0/io.c Fri Dec 26 17:04:01 2003 >--- rsync-2.6.0-patched/io.c Fri Dec 2 23:30:26 2005 >*************** >*** 594,604 **** > **/ > static void writefd_unbuffered(int fd,char *buf,size_t len) > { > size_t total = 0; > fd_set w_fds, r_fds; >! int fd_count, count; > struct timeval tv; > > err_list_push(); > > no_flush++; >--- 594,604 ---- > **/ > static void writefd_unbuffered(int fd,char *buf,size_t len) > { > size_t total = 0; > fd_set w_fds, r_fds; >! int fd_count; > struct timeval tv; > > err_list_push(); > > no_flush++; >*************** >*** 618,642 **** > tv.tv_sec = io_timeout?io_timeout:SELECT_TIMEOUT; > tv.tv_usec = 0; > > errno = 0; > >! count = select(fd_count+1, > io_error_fd != -1?&r_fds:NULL, > &w_fds,NULL, > &tv); > >! if (count == 0) { >! check_timeout(); >! } > >! if (count <= 0) { >! if (errno == EBADF) { >! exit_cleanup(RERR_SOCKETIO); > } >! continue; > } > > if (io_error_fd != -1 && FD_ISSET(io_error_fd, &r_fds)) { > read_error_fd(); > } > >--- 618,652 ---- > tv.tv_sec = io_timeout?io_timeout:SELECT_TIMEOUT; > tv.tv_usec = 0; > > errno = 0; > >! if (io_timeout > 0 || io_error_fd != -1) >! { >! /* A timeout is possible, or there may be data on >! * the error stream. We cannot risk blocking >! * in write(), so we have to call select() to see >! * if fd is ready for writing. >! */ >! int count = select(fd_count+1, > io_error_fd != -1?&r_fds:NULL, > &w_fds,NULL, > &tv); > >! if (count == 0) { >! check_timeout(); >! } > >! if (count <= 0) { >! if (errno == EBADF) { >! exit_cleanup(RERR_SOCKETIO); >! } >! continue; > } >! /* count > 0, so fall through with correct values in r_fds and w_fds. */ > } >+ /* If we didn't call select() then FD_ISSET(fd,&w_fds) is still true. */ > > if (io_error_fd != -1 && FD_ISSET(io_error_fd, &r_fds)) { > read_error_fd(); > } >
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 3271
:
1580
|
1594
|
1595
|
1604
| 1605