From 6b394c1cd36f5aef40d9b17fa0b76cf0a9fd3cc6 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 26 Feb 2004 21:08:06 -0500 Subject: [PATCH] filefrag.c: Fix gcc -Wall nits. --- misc/ChangeLog | 2 ++ misc/filefrag.c | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/misc/ChangeLog b/misc/ChangeLog index bf5d709..30f2e4e 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,5 +1,7 @@ 2004-02-26 Theodore Ts'o + * filefrag.c: Fix gcc -Wall nits. + * badblocks.c (pattern_fill): Fix bug accidentally added when fixing up gcc -Wall nits. badblocks -t random was not getting handled properly because ~0 needed to be cast to diff --git a/misc/filefrag.c b/misc/filefrag.c index 90137aa..e40941d 100644 --- a/misc/filefrag.c +++ b/misc/filefrag.c @@ -27,6 +27,12 @@ int main(void) { #include #include #include +#ifdef HAVE_GETOPT_H +#include +#else +extern char *optarg; +extern int optind; +#endif #include #include #include @@ -57,11 +63,11 @@ static unsigned long get_bmap(int fd, unsigned long block) #define EXT2_DIRECT 12 -void frag_report(const char *filename) +static void frag_report(const char *filename) { struct statfs fsinfo; struct stat64 fileinfo; - long i, fd, bs, block, last_block, numblocks; + long i, fd, bs, block, last_block = 0, numblocks; long bpib; /* Blocks per indirect block */ long cylgroups; int discont = 0, expected; @@ -138,7 +144,7 @@ void frag_report(const char *filename) } -void usage(const char *progname) +static void usage(const char *progname) { fprintf(stderr, "Usage: %s [-v] file ...\n", progname); exit(1); -- 1.8.3.1