summaryrefslogtreecommitdiffstats
path: root/sys-utils/losetup.c
diff options
context:
space:
mode:
authorKarel Zak2011-12-22 11:07:21 +0100
committerKarel Zak2011-12-22 12:19:38 +0100
commit6da69b83a65bfdfd4171c58213ef20c549f7f7c8 (patch)
treed0aaf8800d2ed9c221c8ba29eefcc054ac973361 /sys-utils/losetup.c
parentlosetup: print info about one device (diff)
downloadkernel-qcow2-util-linux-6da69b83a65bfdfd4171c58213ef20c549f7f7c8.tar.gz
kernel-qcow2-util-linux-6da69b83a65bfdfd4171c58213ef20c549f7f7c8.tar.xz
kernel-qcow2-util-linux-6da69b83a65bfdfd4171c58213ef20c549f7f7c8.zip
losetup: check to control debug output
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/losetup.c')
-rw-r--r--sys-utils/losetup.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c
index af4d1b098..b03dc90a7 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) {