]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/util/getiface.c
Merge remote-tracking branch 'origin/branch-netatalk-3-1'
[netatalk.git] / libatalk / util / getiface.c
index 52f2f7e9a45ddda324dccd508262c27f6409b83f..bf79fff7f49e62f63983583aeb0b2b7cb4934d0c 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-
-#ifdef HAVE_STDINT_H
 #include <stdint.h>
-#endif
-
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
@@ -92,7 +88,7 @@ static int getifaces(const int sockfd, char ***list)
     }
 
        new = (char **) malloc((ifc.ifc_len/sizeof(struct ifreq) + 1) * sizeof(char *));
-    for ( ifr = ifc.ifc_req; ifc.ifc_len >= sizeof( struct ifreq );
+    for ( ifr = ifc.ifc_req; ifc.ifc_len >= (int) sizeof( struct ifreq );
            ifc.ifc_len -= ifrsize, ifr = nextifr ) {
 #ifdef BSD4_4
        ifrsize = sizeof(ifr->ifr_name) +
@@ -117,9 +113,9 @@ static int getifaces(const int sockfd, char ***list)
  * Get interfaces from the kernel. we keep an extra null entry to signify
  * the end of the interface list. 
  */
-char **getifacelist()
+char **getifacelist(void)
 {
-  char **list;
+  char **list = NULL; /* FIXME */
   int  i, fd;
 
   if ((fd = socket(PF_INET, SOCK_STREAM, 0)) < 0)