diff options
author | Volker Lendecke <vl@samba.org> | 2011-02-07 17:17:26 +0100 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2011-02-28 16:40:19 +0100 |
commit | b28a2e519a0f36da800b0fdab295c1875401ac84 (patch) | |
tree | 24aa50dbdd73c39e5c851b39e35225949c8bc3f9 /source3/client | |
parent | 89d81b310ec0f1bc7987f452eadc544403ee77ec (diff) | |
download | samba-b28a2e519a0f36da800b0fdab295c1875401ac84.tar.gz samba-b28a2e519a0f36da800b0fdab295c1875401ac84.tar.xz samba-b28a2e519a0f36da800b0fdab295c1875401ac84.zip |
s3: Eliminate sys_select from do_smb_browse() -- untested
Diffstat (limited to 'source3/client')
-rw-r--r-- | source3/client/dnsbrowse.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/source3/client/dnsbrowse.c b/source3/client/dnsbrowse.c index 5e3a4de9cf..c62f27beea 100644 --- a/source3/client/dnsbrowse.c +++ b/source3/client/dnsbrowse.c @@ -23,6 +23,7 @@ #ifdef WITH_DNSSD_SUPPORT #include <dns_sd.h> +#include "system/select.h" /* Holds service instances found during DNS browse */ struct mdns_smbsrv_result @@ -155,7 +156,6 @@ int do_smb_browse(void) int mdnsfd; int fdsetsz; int ret; - fd_set *fdset = NULL; struct mdns_browse_state bstate; struct mdns_smbsrv_result *resptr; struct timeval tv; @@ -177,24 +177,14 @@ int do_smb_browse(void) 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, &revents, 1000); if (ret <= 0 && errno != EINTR) { break; } - if (FD_ISSET(mdnsfd, fdset)) { + if (revents & (POLLIN|POLLHUP|POLLERR)) { /* Invoke callback function */ if (DNSServiceProcessResult(mdns_conn_sdref)) { break; |