Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/client/dnsbrowse.c

    r591 r740  
    2424
    2525#include <dns_sd.h>
     26#include "system/select.h"
    2627
    2728/* Holds service instances found during DNS browse */
     
    6162        int fdsetsz;
    6263        int ret;
    63         fd_set *fdset = NULL;
    6464        struct timeval tv;
    6565        DNSServiceErrorType err;
     
    7878        mdnsfd = DNSServiceRefSockFD(mdns_conn_sdref);
    7979        for (;;)  {
    80                 if (fdset != NULL) {
    81                         TALLOC_FREE(fdset);
    82                 }
    83 
    84                 if (mdnsfd < 0 || mdnsfd >= FD_SETSIZE) {
    85                         errno = EBADF;
    86                         break;
    87                 }
    88 
    89                 fdsetsz = howmany(mdnsfd + 1, NFDBITS) * sizeof(fd_mask);
    90                 fdset = TALLOC_ZERO(ctx, fdsetsz);
    91                 FD_SET(mdnsfd, fdset);
    92 
    93                 tv.tv_sec = 1;
    94                 tv.tv_usec = 0;
    95 
    96                 /* Wait until response received from mDNS daemon */
    97                 ret = sys_select(mdnsfd + 1, fdset, NULL, NULL, &tv);
     80                int revents;
     81
     82                ret = poll_one_fd(mdnsfd, POLLIN|POLLHUP, 1000, &revents);
    9883                if (ret <= 0 && errno != EINTR) {
    9984                        break;
    10085                }
    10186
    102                 if (FD_ISSET(mdnsfd, fdset)) {
     87                if (revents & (POLLIN|POLLHUP|POLLERR)) {
    10388                        /* Invoke callback function */
    10489                        DNSServiceProcessResult(mdns_conn_sdref);
     
    161146        int fdsetsz;
    162147        int ret;
    163         fd_set *fdset = NULL;
    164148        struct mdns_browse_state bstate;
    165149        struct mdns_smbsrv_result *resptr;
     
    183167        mdnsfd = DNSServiceRefSockFD(mdns_conn_sdref);
    184168        for (;;)  {
    185                 if (fdset != NULL) {
    186                         TALLOC_FREE(fdset);
    187                 }
    188 
    189                 if (mdnsfd < 0 || mdnsfd >= FD_SETSIZE) {
    190                         errno = EBADF;
    191                         TALLOC_FREE(ctx);
    192                         return 1;
    193                 }
    194 
    195                 fdsetsz = howmany(mdnsfd + 1, NFDBITS) * sizeof(fd_mask);
    196                 fdset = TALLOC_ZERO(ctx, fdsetsz);
    197                 FD_SET(mdnsfd, fdset);
    198 
    199                 tv.tv_sec = 1;
    200                 tv.tv_usec = 0;
    201 
    202                 /* Wait until response received from mDNS daemon */
    203                 ret = sys_select(mdnsfd + 1, fdset, NULL, NULL, &tv);
     169                int revents;
     170
     171                ret = poll_one_fd(mdnsfd, POLLIN|POLLHUP, &revents, 1000);
    204172                if (ret <= 0 && errno != EINTR) {
    205173                        break;
    206174                }
    207175
    208                 if (FD_ISSET(mdnsfd, fdset)) {
     176                if (revents & (POLLIN|POLLHUP|POLLERR)) {
    209177                        /* Invoke callback function */
    210178                        if (DNSServiceProcessResult(mdns_conn_sdref)) {
Note: See TracChangeset for help on using the changeset viewer.