]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
losetup: check to control debug output
authorKarel Zak <kzak@redhat.com>
Thu, 22 Dec 2011 10:07:21 +0000 (11:07 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 22 Dec 2011 11:19:38 +0000 (12:19 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/losetup.c

index af4d1b0988d5ad0fadbe7ecb72ecd09e6bb25cec..b03dc90a713c770137808645afa9d27483001ac8 100644 (file)
@@ -228,10 +228,7 @@ int main(int argc, char **argv)
        uint64_t offset = 0, sizelimit = 0;
        int res = 0, showdev = 0, lo_flags = 0;
 
-       loopcxt_init(&lc, 0);
-       /*loopcxt_enable_debug(&lc, TRUE);*/
-
-       static const struct option longopts[] = {
+               static const struct option longopts[] = {
                { "all", 0, 0, 'a' },
                { "set-capacity", 1, 0, 'c' },
                { "detach", 1, 0, 'd' },
@@ -253,6 +250,9 @@ int main(int argc, char **argv)
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
 
+       loopcxt_init(&lc, 0);
+       loopcxt_enable_debug(&lc, getenv("LOOPDEV_DEBUG") ? TRUE : FALSE);
+
        while ((c = getopt_long(argc, argv, "ac:d:De:E:fhj:o:p:rsv",
                                longopts, NULL)) != -1) {