The Samba-Bugzilla – Attachment 2169 Details for
Bug 4139
Generator process (running as daemon) hangs after kill SIGINT.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add exception fd_sets to recevier, generator's select()
select.diff (text/plain), 1.64 KB, created by
Hugh Daschbach
on 2006-09-30 15:21:16 UTC
(
hide
)
Description:
Add exception fd_sets to recevier, generator's select()
Filename:
MIME Type:
Creator:
Hugh Daschbach
Created:
2006-09-30 15:21:16 UTC
Size:
1.64 KB
patch
obsolete
>Index: io.c >=================================================================== >--- io.c (revision 1654) >+++ io.c (working copy) >@@ -643,13 +643,21 @@ int read_filesfrom_line(int fd, char *fn > if (cnt < 0 && (errno == EWOULDBLOCK > || errno == EINTR || errno == EAGAIN)) { > struct timeval tv; >- fd_set fds; >+ fd_set fds, e_fds;; > FD_ZERO(&fds); > FD_SET(fd, &fds); >+ FD_ZERO(&e_fds); >+ FD_SET(fd, &e_fds); > tv.tv_sec = select_timeout; > tv.tv_usec = 0; >- if (!select(fd+1, &fds, NULL, NULL, &tv)) >+ if (!select(fd+1, &fds, NULL, &e_fds, &tv)) > check_timeout(); >+ if (FD_ISSET(fd, &e_fds)) { >+ rprintf(FINFO, "select error: exception " >+ "fd = %d, errno = %d\n", >+ fd, errno); >+ } >+ > continue; > } > if (cnt != 1) >@@ -1046,7 +1054,7 @@ static void sleep_for_bwlimit(int bytes_ > static void writefd_unbuffered(int fd,char *buf,size_t len) > { > size_t n, total = 0; >- fd_set w_fds, r_fds; >+ fd_set w_fds, r_fds, e_fds; > int maxfd, count, cnt, using_r_fds; > int defer_save = defer_forwarding_messages; > struct timeval tv; >@@ -1056,6 +1064,8 @@ static void writefd_unbuffered(int fd,ch > while (total < len) { > FD_ZERO(&w_fds); > FD_SET(fd,&w_fds); >+ FD_ZERO(&e_fds); >+ FD_SET(fd,&e_fds); > maxfd = fd; > > if (msg_fd_in >= 0) { >@@ -1072,7 +1082,13 @@ static void writefd_unbuffered(int fd,ch > > errno = 0; > count = select(maxfd + 1, using_r_fds ? &r_fds : NULL, >- &w_fds, NULL, &tv); >+ &w_fds, &e_fds, &tv); >+ >+ if (FD_ISSET(fd, &e_fds)) { >+ rprintf(FINFO, "select error: exception fd = %d, " >+ "errno = %d\n", >+ fd, errno); >+ } > > if (count <= 0) { > if (count < 0 && errno == EBADF)
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 4139
: 2169