diff options
-rw-r--r-- | sbin/fsck/Makefile | 1 | ||||
-rw-r--r-- | sbin/fsck/fsck.c | 17 | ||||
-rw-r--r-- | sbin/fsck/fsutil.h | 2 | ||||
-rw-r--r-- | sbin/fsck/preen.c | 6 | ||||
-rw-r--r-- | sbin/fsck_msdosfs/Makefile | 1 | ||||
-rw-r--r-- | sbin/fsck_msdosfs/boot.c | 2 | ||||
-rw-r--r-- | sbin/fsck_msdosfs/ext.h | 2 | ||||
-rw-r--r-- | sbin/fsck_msdosfs/fat.c | 2 |
8 files changed, 16 insertions, 17 deletions
diff --git a/sbin/fsck/Makefile b/sbin/fsck/Makefile index bc445fd..22de03c 100644 --- a/sbin/fsck/Makefile +++ b/sbin/fsck/Makefile @@ -3,7 +3,6 @@ PROG= fsck SRCS= fsck.c fsutil.c preen.c -WARNS?= 2 MAN= fsck.8 .include <bsd.prog.mk> diff --git a/sbin/fsck/fsck.c b/sbin/fsck/fsck.c index 9812b65..6bc702e 100644 --- a/sbin/fsck/fsck.c +++ b/sbin/fsck/fsck.c @@ -73,14 +73,14 @@ static char *options = NULL; static int flags = 0; static int forceflag = 0; -static int checkfs(const char *, const char *, const char *, char *, pid_t *); +static int checkfs(const char *, const char *, const char *, const char *, pid_t *); static int selected(const char *); static void addoption(char *); static const char *getoptions(const char *); static void addentry(struct fstypelist *, const char *, const char *); static void maketypelist(char *); static void catopt(char **, const char *); -static void mangle(char *, int *, const char ***, int *); +static void mangle(char *, int *, const char ** volatile *, int *); static const char *getfslab(const char *); static void usage(void) __dead2; static int isok(struct fstab *); @@ -187,6 +187,7 @@ main(int argc, char *argv[]) char device[MAXPATHLEN]; struct statfs *mntp; + mntpt = NULL; spec = *argv; cp = strrchr(spec, '/'); if (cp == 0) { @@ -285,9 +286,9 @@ isok(struct fstab *fs) static int checkfs(const char *pvfstype, const char *spec, const char *mntpt, - char *auxopt, pid_t *pidp) + const char *auxopt, pid_t *pidp) { - const char **argv; + const char ** volatile argv; pid_t pid; int argc, i, status, maxargc; char *optbuf, execbase[MAXPATHLEN]; @@ -312,7 +313,7 @@ checkfs(const char *pvfstype, const char *spec, const char *mntpt, vfstype = strdup(pvfstype); if (vfstype == NULL) perr("strdup(pvfstype)"); - for (i = 0; i < strlen(vfstype); i++) { + for (i = 0; i < (int)strlen(vfstype); i++) { vfstype[i] = tolower(vfstype[i]); if (vfstype[i] == ' ') vfstype[i] = '_'; @@ -361,7 +362,7 @@ checkfs(const char *pvfstype, const char *spec, const char *mntpt, _exit(0); /* Go find an executable. */ - execvP(execbase, _PATH_SYSPATH, (char * const *)argv); + execvP(execbase, _PATH_SYSPATH, __DECONST(char * const *, argv)); if (spec) warn("exec %s for %s in %s", execbase, spec, _PATH_SYSPATH); else @@ -498,7 +499,7 @@ catopt(char **sp, const char *o) static void -mangle(char *opts, int *argcp, const char ***argvp, int *maxargcp) +mangle(char *opts, int *argcp, const char ** volatile *argvp, int *maxargcp) { char *p, *s; int argc, maxargc; @@ -535,7 +536,7 @@ mangle(char *opts, int *argcp, const char ***argvp, int *maxargcp) } -const static char * +static const char * getfslab(const char *str) { struct disklabel dl; diff --git a/sbin/fsck/fsutil.h b/sbin/fsck/fsutil.h index b1ce6f1..013b821 100644 --- a/sbin/fsck/fsutil.h +++ b/sbin/fsck/fsutil.h @@ -47,4 +47,4 @@ char *estrdup(const char *); struct fstab; int checkfstab(int, int (*)(struct fstab *), - int (*) (const char *, const char *, const char *, char *, pid_t *)); + int (*) (const char *, const char *, const char *, const char *, pid_t *)); diff --git a/sbin/fsck/preen.c b/sbin/fsck/preen.c index 1437e11..18f2801 100644 --- a/sbin/fsck/preen.c +++ b/sbin/fsck/preen.c @@ -78,12 +78,12 @@ static int nrun = 0, ndisks = 0; static struct diskentry *finddisk(const char *); static void addpart(const char *, const char *, const char *); static int startdisk(struct diskentry *, - int (*)(const char *, const char *, const char *, char *, pid_t *)); + int (*)(const char *, const char *, const char *, const char *, pid_t *)); static void printpart(void); int checkfstab(int flags, int (*docheck)(struct fstab *), - int (*checkit)(const char *, const char *, const char *, char *, pid_t *)) + int (*checkit)(const char *, const char *, const char *, const char *, pid_t *)) { struct fstab *fs; struct diskentry *d, *nextdisk; @@ -317,7 +317,7 @@ addpart(const char *type, const char *dev, const char *mntpt) static int startdisk(struct diskentry *d, int (*checkit)(const char *, const char *, - const char *, char *, pid_t *)) + const char *, const char *, pid_t *)) { struct partentry *p = TAILQ_FIRST(&d->d_part); int rv; diff --git a/sbin/fsck_msdosfs/Makefile b/sbin/fsck_msdosfs/Makefile index ddb8e8a..f9dd9fa 100644 --- a/sbin/fsck_msdosfs/Makefile +++ b/sbin/fsck_msdosfs/Makefile @@ -9,6 +9,5 @@ MAN= fsck_msdosfs.8 SRCS= main.c check.c boot.c fat.c dir.c fsutil.c CFLAGS+= -I${FSCK} -WARNS?= 2 .include <bsd.prog.mk> diff --git a/sbin/fsck_msdosfs/boot.c b/sbin/fsck_msdosfs/boot.c index 97d9419..3195183 100644 --- a/sbin/fsck_msdosfs/boot.c +++ b/sbin/fsck_msdosfs/boot.c @@ -48,7 +48,7 @@ readboot(int dosfs, struct bootblock *boot) int ret = FSOK; int i; - if (read(dosfs, block, sizeof block) != sizeof block) { + if ((size_t)read(dosfs, block, sizeof block) != sizeof block) { perr("could not read boot block"); return FSFATAL; } diff --git a/sbin/fsck_msdosfs/ext.h b/sbin/fsck_msdosfs/ext.h index a4fd19b..681cde9 100644 --- a/sbin/fsck_msdosfs/ext.h +++ b/sbin/fsck_msdosfs/ext.h @@ -133,7 +133,7 @@ void finishlf(void); /* * Return the type of a reserved cluster as text */ -char *rsrvdcltype(cl_t); +const char *rsrvdcltype(cl_t); /* * Clear a cluster chain in a FAT diff --git a/sbin/fsck_msdosfs/fat.c b/sbin/fsck_msdosfs/fat.c index 837bd69..d2d1444 100644 --- a/sbin/fsck_msdosfs/fat.c +++ b/sbin/fsck_msdosfs/fat.c @@ -320,7 +320,7 @@ readfat(int fs, struct bootblock *boot, u_int no, struct fatEntry **fp) /* * Get type of reserved cluster */ -char * +const char * rsrvdcltype(cl_t cl) { if (cl == CLUST_FREE) |