From: Tomohiro Kusumi Date: Sat, 14 Sep 2019 20:32:31 +0000 (+0900) Subject: sbin/fsck_msdosfs: Minor fixes/sync with FreeBSD X-Git-Tag: v5.8.0rc1~886 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/7c3df5493c8a6fcc1919b38af077b2f70d5bd0a2 sbin/fsck_msdosfs: Minor fixes/sync with FreeBSD --- diff --git a/sbin/fsck_msdosfs/boot.c b/sbin/fsck_msdosfs/boot.c index 7781bb77df..a3cbeb1370 100644 --- a/sbin/fsck_msdosfs/boot.c +++ b/sbin/fsck_msdosfs/boot.c @@ -258,7 +258,7 @@ writefsinfo(int dosfs, struct bootblock *boot) * correctly, it has to be fixed pretty often. * * Therefor, we handle the FSINFO block only informally, - * fixing it if neccessary, but otherwise ignoring the + * fixing it if necessary, but otherwise ignoring the * fact that it was incorrect. */ return 0; diff --git a/sbin/fsck_msdosfs/dir.c b/sbin/fsck_msdosfs/dir.c index 2d6dda71d8..4f2afe38ec 100644 --- a/sbin/fsck_msdosfs/dir.c +++ b/sbin/fsck_msdosfs/dir.c @@ -147,7 +147,7 @@ freeDirTodo(struct dirTodoNode *dt) /* * The stack of unread directories */ -struct dirTodoNode *pendingDirectories = NULL; +static struct dirTodoNode *pendingDirectories = NULL; /* * Return the full pathname for a directory entry. @@ -204,7 +204,7 @@ static char longName[DOSLONGNAMELEN] = ""; static u_char *buffer = NULL; static u_char *delbuf = NULL; -struct dosDirEntry *rootDir; +static struct dosDirEntry *rootDir; static struct dosDirEntry *lostDir; /* @@ -307,7 +307,7 @@ finishDosDirSection(void) */ static int delete(int f, struct bootblock *boot, struct fatEntry *fat, cl_t startcl, - int startoff, cl_t endcl, int endoff, int notlast) + int startoff, cl_t endcl, int endoff, int notlast) { u_char *s, *e; off_t off; @@ -347,8 +347,7 @@ delete(int f, struct bootblock *boot, struct fatEntry *fat, cl_t startcl, static int removede(int f, struct bootblock *boot, struct fatEntry *fat, u_char *start, - u_char *end, cl_t startcl, cl_t endcl, cl_t curcl, char *path, - int type) + u_char *end, cl_t startcl, cl_t endcl, cl_t curcl, char *path, int type) { switch (type) { case 0: @@ -384,7 +383,7 @@ removede(int f, struct bootblock *boot, struct fatEntry *fat, u_char *start, */ static int checksize(struct bootblock *boot, struct fatEntry *fat, u_char *p, - struct dosDirEntry *dir) + struct dosDirEntry *dir) { /* * Check size on ordinary files @@ -505,7 +504,7 @@ check_subdirectory(int f, struct bootblock *boot, struct dosDirEntry *dir) */ static int readDosDirSection(int f, struct bootblock *boot, struct fatEntry *fat, - struct dosDirEntry *dir) + struct dosDirEntry *dir) { struct dosDirEntry dirent, *d; u_char *p, *vallfn, *invlfn, *empty; diff --git a/sbin/fsck_msdosfs/ext.h b/sbin/fsck_msdosfs/ext.h index c001e0cd15..c7e3dc6fe6 100644 --- a/sbin/fsck_msdosfs/ext.h +++ b/sbin/fsck_msdosfs/ext.h @@ -44,8 +44,6 @@ extern int alwaysyes; /* assume "yes" for all questions */ extern int preen; /* we are preening */ extern int rdonly; /* device is opened read only (supersedes above) */ -extern struct dosDirEntry *rootDir; - /* * function declarations */ @@ -127,7 +125,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 693cf845a9..7044b34cc0 100644 --- a/sbin/fsck_msdosfs/fat.c +++ b/sbin/fsck_msdosfs/fat.c @@ -230,7 +230,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) @@ -340,13 +340,13 @@ clearchain(struct bootblock *boot, struct fatEntry *fat, cl_t head) } int -tryclear(struct bootblock *boot, struct fatEntry *fat, cl_t head, cl_t *trunc) +tryclear(struct bootblock *boot, struct fatEntry *fat, cl_t head, cl_t *truncp) { if (ask(0, "Clear chain starting at %u", head)) { clearchain(boot, fat, head); return FSFATMOD; } else if (ask(0, "Truncate")) { - *trunc = CLUST_EOF; + *truncp = CLUST_EOF; return FSFATMOD; } else return FSERROR; diff --git a/sbin/fsck_msdosfs/main.c b/sbin/fsck_msdosfs/main.c index d11e79b294..478d4d58bb 100644 --- a/sbin/fsck_msdosfs/main.c +++ b/sbin/fsck_msdosfs/main.c @@ -40,7 +40,7 @@ int alwaysyes; /* assume "yes" for all questions */ int preen; /* set when preening */ int rdonly; /* device is opened read only (supersedes above) */ -static void usage(void); +static void usage(void) __dead2; static void usage(void)