summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-02-07 17:02:44 +0100
committerVolker Lendecke <vlendec@samba.org>2011-02-28 16:40:19 +0100
commit0f082de561342b88ffd239b6cc3e11e059225380 (patch)
treeb01a955169bea2e4d0a3948995ee613a374e34c8 /source3/smbd
parent2b0057c2cb4f05005354008044049fc3dc2bd1fd (diff)
downloadsamba-0f082de561342b88ffd239b6cc3e11e059225380.tar.gz
samba-0f082de561342b88ffd239b6cc3e11e059225380.tar.bz2
samba-0f082de561342b88ffd239b6cc3e11e059225380.zip
s3: Eliminate sys_select from fd_is_readable
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/process.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index c0f33fd4f8..48d317bba2 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -2224,18 +2224,12 @@ static void check_reload(struct smbd_server_connection *sconn, time_t t)
static bool fd_is_readable(int fd)
{
- fd_set fds;
- struct timeval timeout = {0, };
- int ret;
+ int ret, revents;
- FD_ZERO(&fds);
- FD_SET(fd, &fds);
+ ret = poll_one_fd(fd, POLLIN|POLLHUP, 0, &revents);
+
+ return ((ret > 0) && ((revents & (POLLIN|POLLHUP|POLLERR)) != 0));
- ret = sys_select(fd+1, &fds, NULL, NULL, &timeout);
- if (ret == -1) {
- return false;
- }
- return FD_ISSET(fd, &fds);
}
static void smbd_server_connection_write_handler(struct smbd_server_connection *conn)