diff --git a/sbin/mdmfs/Makefile b/sbin/mdmfs/Makefile index 999793f0e103..1ef708454267 100644 --- a/sbin/mdmfs/Makefile +++ b/sbin/mdmfs/Makefile @@ -4,5 +4,6 @@ PROG= mdmfs LINKS= ${BINDIR}/${PROG} ${BINDIR}/mount_mfs MAN= mdmfs.8 MLINKS+= mdmfs.8 mount_mfs.8 +WARNS?= 6 .include diff --git a/sbin/mdmfs/mdmfs.c b/sbin/mdmfs/mdmfs.c index bed6dc776e00..d276dc01f5e1 100644 --- a/sbin/mdmfs/mdmfs.c +++ b/sbin/mdmfs/mdmfs.c @@ -101,6 +101,7 @@ main(int argc, char **argv) softdep = true; autounit = false; have_mdtype = false; + mdtype = MD_SWAP; mdname = MD_NAME; mdnamelen = strlen(mdname); /* @@ -251,7 +252,7 @@ main(int argc, char **argv) unit = -1; } else { unit = strtoul(unitstr, &p, 10); - if (unit == (unsigned)ULONG_MAX || *p != '\0') + if ((unsigned)unit == (unsigned)ULONG_MAX || *p != '\0') errx(1, "bad device unit: %s", unitstr); } @@ -399,7 +400,7 @@ do_mdconfig_attach_au(const char *args, const enum md_types mdtype) strncpy(linebuf, linep + mdnamelen, linelen); linebuf[linelen] = '\0'; unit = strtoul(linebuf, &p, 10); - if (unit == (unsigned)ULONG_MAX || *p != '\n') + if ((unsigned)unit == (unsigned)ULONG_MAX || *p != '\n') errx(1, "unexpected output from mdconfig (attach)"); fclose(sfd);