summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-02-08 17:56:10 +0100
committerVolker Lendecke <vlendec@samba.org>2011-02-28 16:40:19 +0100
commite6f820835874e6bbf103768665952b7884cd8452 (patch)
treefed4054463ed297edcc0bed23d27ec4575ac860c /source3
parent884984ae0a9b551dcd92d6d0486b2d741eabd20f (diff)
downloadsamba-e6f820835874e6bbf103768665952b7884cd8452.tar.gz
samba-e6f820835874e6bbf103768665952b7884cd8452.tar.bz2
samba-e6f820835874e6bbf103768665952b7884cd8452.zip
s3: Eliminiate sys_select_intr from client.c
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 3e48b01079..1ede29a0e6 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -29,6 +29,7 @@
#include "system/readline.h"
#include "../libcli/smbreadline/smbreadline.h"
#include "../libcli/security/security.h"
+#include "system/select.h"
#ifndef REGISTER
#define REGISTER 0
@@ -4735,11 +4736,10 @@ static bool finished;
static void readline_callback(void)
{
- fd_set fds;
- struct timeval timeout;
static time_t last_t;
struct timespec now;
time_t t;
+ int ret, revents;
clock_gettime_mono(&now);
t = now.tv_sec;
@@ -4754,18 +4754,14 @@ static void readline_callback(void)
if (cli->fd == -1)
return;
- FD_ZERO(&fds);
- FD_SET(cli->fd,&fds);
-
- timeout.tv_sec = 0;
- timeout.tv_usec = 0;
- sys_select_intr(cli->fd+1,&fds,NULL,NULL,&timeout);
-
/* We deliberately use receive_smb_raw instead of
client_receive_smb as we want to receive
session keepalives and then drop them here.
*/
- if (FD_ISSET(cli->fd,&fds)) {
+
+ ret = poll_intr_one_fd(cli->fd, POLLIN|POLLHUP, 0, &revents);
+
+ if ((ret > 0) && (revents & (POLLIN|POLLHUP|POLLERR))) {
NTSTATUS status;
size_t len;