diff options
author | Volker Lendecke <vl@samba.org> | 2011-02-07 17:02:44 +0100 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2011-02-28 16:40:19 +0100 |
commit | 0f082de561342b88ffd239b6cc3e11e059225380 (patch) | |
tree | b01a955169bea2e4d0a3948995ee613a374e34c8 | |
parent | 2b0057c2cb4f05005354008044049fc3dc2bd1fd (diff) | |
download | samba-0f082de561342b88ffd239b6cc3e11e059225380.tar.gz samba-0f082de561342b88ffd239b6cc3e11e059225380.tar.bz2 samba-0f082de561342b88ffd239b6cc3e11e059225380.zip |
s3: Eliminate sys_select from fd_is_readable
-rw-r--r-- | source3/smbd/process.c | 14 |
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) |