ifconfig(8): Raise WARNS to 2 and fix the resulting warnings.
authorSascha Wildner <saw@online.de>
Sun, 25 Apr 2010 12:00:35 +0000 (14:00 +0200)
committerSascha Wildner <saw@online.de>
Sun, 25 Apr 2010 12:00:35 +0000 (14:00 +0200)
sbin/ifconfig/Makefile
sbin/ifconfig/ifcarp.c
sbin/ifconfig/ifconfig.c

index 444cb11..9430688 100644 (file)
@@ -37,6 +37,6 @@ LDADD=        -lipx -lbsdxml -lsbuf
 
 MAN=   ifconfig.8
 
-WARNS= 0
+WARNS= 2
 
 .include <bsd.prog.mk>
index 38feeae..cc2c8fa 100644 (file)
@@ -70,7 +70,6 @@ carp_status(int s)
        struct carpreq carpr;
        struct ifdrv ifd;
        char devname[IFNAMSIZ];
-       int count, i;
 
        memset((char *)&carpr, 0, sizeof(struct carpreq));
        ifr.ifr_data = (caddr_t)&carpr;
@@ -188,7 +187,6 @@ getcarp_vhaddr(const char *val, int d, int s, const struct afswtch *afp)
 
        struct ifdrv ifd;
        struct ifcarpvhaddr *carpa;
-       char devname[IFNAMSIZ];
        int count, i;
 
        memset(&ifd, 0, sizeof(ifd));
index ab3e17d..5ec2e90 100644 (file)
@@ -370,7 +370,6 @@ retry:
 
        if (namesonly && need_nl > 0)
                putchar('\n');
-end:
        if (printname)
                printf("%s\n", name);
 
@@ -458,7 +457,7 @@ cmd_lookup(const char *name, int iscreate)
        const struct cmd *p;
 
        for (p = cmds; p != NULL; p = p->c_next)
-               if (strcmp(name, p->c_name) == 0)
+               if (strcmp(name, p->c_name) == 0) {
                        if (iscreate) {
                                if (p->c_iscloneop)
                                        return p;
@@ -466,7 +465,7 @@ cmd_lookup(const char *name, int iscreate)
                                if (!p->c_iscloneop)
                                        return p;
                        }
-                       return p;
+               }
        return NULL;
 #undef N
 }