From: Karel Zak Date: Thu, 22 Dec 2011 10:07:21 +0000 (+0100) Subject: losetup: check to control debug output X-Git-Tag: v2.21-rc1~95 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6da69b83a65bfdfd4171c58213ef20c549f7f7c8;p=thirdparty%2Futil-linux.git losetup: check to control debug output Signed-off-by: Karel Zak --- diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c index af4d1b0988..b03dc90a71 100644 --- a/sys-utils/losetup.c +++ b/sys-utils/losetup.c @@ -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) {