fixed bug on android with previous commit

This commit is contained in:
gardners 2012-05-03 17:17:56 +09:30
parent 82ca3dde5d
commit 6e933be9ec

6
lsif.c
View File

@ -74,7 +74,7 @@ int lsif(void)
/* Get a socket handle. */
sck = socket(PF_INET, SOCK_DGRAM, 0);
if(sck < 0) {
WHY("Failed to gt socket handle to list addresses");
fprintf(stderr,"Failed to gt socket handle to list addresses\n");
return 1;
}
@ -82,14 +82,14 @@ int lsif(void)
ifc.ifc_len = sizeof(buf);
ifc.ifc_buf = buf;
if(ioctl(sck, SIOCGIFCONF, &ifc) < 0) {
WHY("Failed to read interface list");
fprintf(stderr,"Failed to read interface list\n");
return 1;
}
/* Iterate through the list of interfaces. */
ifr = ifc.ifc_req;
nInterfaces = ifc.ifc_len / sizeof(struct ifreq);
WHYF("Examining %d interfaces",nInterfaces);
fprintf(stderr,"Examining %d interfaces\n",nInterfaces);
for(i = 0; i < nInterfaces; i++) {
item = &ifr[i];