git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6492ffd
)
Fix closed_fd(): select returning 0 means no fd listening
author
Volker Lendecke
<vl@samba.org>
Fri, 22 May 2009 17:29:46 +0000
(19:29 +0200)
committer
Volker Lendecke
<vl@samba.org>
Sun, 24 May 2009 11:50:35 +0000
(13:50 +0200)
source3/lib/wb_reqtrans.c
patch
|
blob
|
history
diff --git
a/source3/lib/wb_reqtrans.c
b/source3/lib/wb_reqtrans.c
index 16d71fe03e36aadc715380e3810ca6bfed1e96bd..038e5bda171d3586c46cd48b399675ea39087933 100644
(file)
--- a/
source3/lib/wb_reqtrans.c
+++ b/
source3/lib/wb_reqtrans.c
@@
-342,6
+342,7
@@
static bool closed_fd(int fd)
{
struct timeval tv;
fd_set r_fds;
+ int selret;
if (fd == -1) {
return true;
@@
-351,12
+352,14
@@
static bool closed_fd(int fd)
FD_SET(fd, &r_fds);
ZERO_STRUCT(tv);
- if ((select(fd+1, &r_fds, NULL, NULL, &tv) == -1)
-
|| FD_ISSET(fd, &r_fds)
) {
+ selret = select(fd+1, &r_fds, NULL, NULL, &tv);
+
if (selret == -1
) {
return true;
}
-
- return false;
+ if (selret == 0) {
+ return false;
+ }
+ return (FD_ISSET(fd, &r_fds));
}
struct wb_simple_trans_state {