[fix] - fix allocation of if list for osx
authorMemphiz <memphis@machzwo.de>
Mon, 11 Jul 2011 17:16:13 +0000 (19:16 +0200)
committerMemphiz <memphis@machzwo.de>
Mon, 11 Jul 2011 17:16:13 +0000 (19:16 +0200)
- removed one unneeded header in examples/nfsclient-bcast.c which was breaking build under osx

examples/nfsclient-bcast.c
lib/libnfs-sync.c

index 89b1376aae9c9dcb1026202e732c680133ad42b3..498e0e7f4fcbad8c4b79ec84533cbe9d930cf849 100644 (file)
@@ -32,7 +32,6 @@
 #include <netdb.h>
 #include "libnfs.h"
 #include "libnfs-raw.h"
-#include "libnfs-private.h"
 #include "libnfs-raw-mount.h"
 #include "libnfs-raw-portmap.h"
 
@@ -128,7 +127,7 @@ int main(int argc _U_, char *argv[] _U_)
        ifc.ifc_buf = NULL;
        ifc.ifc_len = size;
 
-       while (ifc.ifc_len == size) {
+       while(ifc.ifc_len > (size - sizeof(struct ifreq))) {
                size *= 2;
 
                free(ifc.ifc_buf);      
index faf85458a02be7e03335ff3efd297e11d5749290..0a57c7b97e562c1844fd0b183271d1ff8fea2b7f 100644 (file)
@@ -1227,7 +1227,7 @@ struct nfs_server_list *nfs_find_local_servers(void)
        ifc.ifc_buf = NULL;
        ifc.ifc_len = size;
 
-       while (ifc.ifc_len == size) {
+       while(ifc.ifc_len > (size - sizeof(struct ifreq))) {
                size *= 2;
 
                free(ifc.ifc_buf);