summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-02-07 17:19:03 +0100
committerVolker Lendecke <vlendec@samba.org>2011-02-28 16:40:20 +0100
commit5b26cfe14395ce09461de9423bd745570702fd9e (patch)
tree9f9105232e671f0cb0413f0fa0d7b407065a56f9 /source3
parentb28a2e519a0f36da800b0fdab295c1875401ac84 (diff)
downloadsamba-5b26cfe14395ce09461de9423bd745570702fd9e.tar.gz
samba-5b26cfe14395ce09461de9423bd745570702fd9e.tar.bz2
samba-5b26cfe14395ce09461de9423bd745570702fd9e.zip
s3: Eliminate sys_select from do_smb_resolve() -- untested
Diffstat (limited to 'source3')
-rw-r--r--source3/client/dnsbrowse.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/source3/client/dnsbrowse.c b/source3/client/dnsbrowse.c
index c62f27beea..c252b25343 100644
--- a/source3/client/dnsbrowse.c
+++ b/source3/client/dnsbrowse.c
@@ -61,7 +61,6 @@ static void do_smb_resolve(struct mdns_smbsrv_result *browsesrv)
int mdnsfd;
int fdsetsz;
int ret;
- fd_set *fdset = NULL;
struct timeval tv;
DNSServiceErrorType err;
@@ -78,24 +77,14 @@ static void do_smb_resolve(struct mdns_smbsrv_result *browsesrv)
mdnsfd = DNSServiceRefSockFD(mdns_conn_sdref);
for (;;) {
- if (fdset != NULL) {
- TALLOC_FREE(fdset);
- }
-
- fdsetsz = howmany(mdnsfd + 1, NFDBITS) * sizeof(fd_mask);
- fdset = TALLOC_ZERO(ctx, fdsetsz);
- FD_SET(mdnsfd, fdset);
-
- tv.tv_sec = 1;
- tv.tv_usec = 0;
+ int revents;
- /* Wait until response received from mDNS daemon */
- ret = sys_select(mdnsfd + 1, fdset, NULL, NULL, &tv);
+ ret = poll_one_fd(mdnsfd, POLLIN|POLLHUP, 1000, &revents);
if (ret <= 0 && errno != EINTR) {
break;
}
- if (FD_ISSET(mdnsfd, fdset)) {
+ if (revents & (POLLIN|POLLHUP|POLLERR)) {
/* Invoke callback function */
DNSServiceProcessResult(mdns_conn_sdref);
break;