Ignore:
Timestamp:
Jun 10, 2009, 5:36:01 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Fix for interface list (by diver) in 3.3 branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/lib/replace/getifaddrs.c

    r221 r258  
    262262        struct ifaddrs *curif;
    263263        struct ifaddrs *lastif = NULL;
     264#ifdef __OS2__
     265        int total = 0;
     266#endif
    264267
    265268        *ifap = NULL;
     
    288291
    289292                if (ioctl(fd, SIOCGIFADDR, ifr) != 0) {
     293#ifndef __OS2__
    290294                        freeaddrinfo(*ifap);
    291295                        return -1;
     296#else
     297   goto next;
     298#endif
    292299                }
    293300
     
    307314
    308315                if (ioctl(fd, SIOCGIFFLAGS, ifr) != 0) {
     316#ifndef __OS2__
    309317                        freeaddrinfo(*ifap);
    310318                        return -1;
     319#else
     320   goto next;
     321#endif
    311322                }
    312323
     
    314325
    315326                if (ioctl(fd, SIOCGIFNETMASK, ifr) != 0) {
     327#ifndef __OS2__
    316328                        freeaddrinfo(*ifap);
    317329                        return -1;
     330#else
     331   goto next;
     332#endif
    318333                }
    319334
     
    321336
    322337                lastif = curif;
     338  total ++;
    323339
    324340        next:
     
    339355
    340356        close(fd);
     357#ifndef __OS2__
    341358        return 0;
     359#else
     360   if (total == 0) {
     361                          freeifaddrs(*ifap);
     362                          return -1;
     363     }
     364#endif
    342365}
    343366
Note: See TracChangeset for help on using the changeset viewer.