Whamcloud - gitweb
filefrag.c: Fix gcc -Wall nits.
authorTheodore Ts'o <tytso@mit.edu>
Fri, 27 Feb 2004 02:08:06 +0000 (21:08 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 27 Feb 2004 02:08:06 +0000 (21:08 -0500)
misc/ChangeLog
misc/filefrag.c

index bf5d709..30f2e4e 100644 (file)
@@ -1,5 +1,7 @@
 2004-02-26  Theodore Ts'o  <tytso@mit.edu>
 
+       * 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
index 90137aa..e40941d 100644 (file)
@@ -27,6 +27,12 @@ int main(void) {
 #include <time.h>
 #include <fcntl.h>
 #include <errno.h>
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#else
+extern char *optarg;
+extern int optind;
+#endif
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/vfs.h>
@@ -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);