mkfs.btrfs: fix error text in '-r' mode
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 4 Jun 2011 08:19:24 +0000 (11:19 +0300)
committerChris Mason <chris.mason@oracle.com>
Tue, 25 Oct 2011 13:18:58 +0000 (09:18 -0400)
Smart gcc noticed use of uninitialized warning when compiled
with -O0 flags:

    mkfs.c:1291: error: 'file' may be used uninitialized in this function

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Hugo Mills <hugo@carfax.org.uk>
mkfs.c

diff --git a/mkfs.c b/mkfs.c
index b93b874..e191b7f 100644 (file)
--- a/mkfs.c
+++ b/mkfs.c
@@ -1287,13 +1287,13 @@ int main(int ac, char **av)
                        block_count = dev_block_count;
        } else {
                ac = 0;
+               file = output;
                fd = open_target(output);
                if (fd < 0) {
                        fprintf(stderr, "unable to open the %s\n", file);
                        exit(1);
                }
 
-               file = output;
                first_file = file;
                block_count = size_sourcedir(source_dir, sectorsize,
                                             &num_of_meta_chunks, &size_of_data);