X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Flistdevip.c;h=e62b4ae0b313f0919b3fb27c9ada1f6cb342c595;hb=2822ba293eb308225c50d346930c47bf98d9927b;hp=84fa38875e65941b1ac5905826427b3629ad4c7b;hpb=06e1018272502e1d15d6d8f32b80fa96420785b8;p=util-vserver.git diff --git a/src/listdevip.c b/src/listdevip.c index 84fa388..e62b4ae 100644 --- a/src/listdevip.c +++ b/src/listdevip.c @@ -1,4 +1,4 @@ -// $Id: listdevip.c,v 1.1 2003/09/29 22:01:57 ensc Exp $ +// $Id: listdevip.c,v 1.3 2004/02/20 16:59:40 ensc Exp $ // Copyright (C) 2003 Enrico Scholz // based on listdevip.cc by Jacques Gelinas @@ -21,6 +21,11 @@ Print the list of all network (IP) devices. Print the IP in fact, including all aliases. */ +#ifdef HAVE_CONFIG_H +# include +#endif +#include "compat.h" + #include #include #include @@ -47,7 +52,7 @@ static int devlist_read2_2() int ret = -1; int skfd = socket (AF_INET,SOCK_DGRAM,0); if (skfd < 0) { - perror ("socket"); + perror ("listdevip: socket()"); }else{ struct ifconf ifc; int numreqs = 30; @@ -58,7 +63,7 @@ static int devlist_read2_2() ifc.ifc_buf = (char*)realloc(ifc.ifc_buf, ifc.ifc_len); if (ioctl(skfd, SIOCGIFCONF, &ifc) < 0) { - perror("SIOCGIFCONF"); + perror("listdevip: SIOCGIFCONF"); ret = -1; break; } @@ -99,7 +104,7 @@ static int devlist_read2_2() return ret; } -int main (int argc, char *argv[]) +int main (int UNUSED argc, char UNUSED *argv[]) { devlist_read2_2(); return 0;