From 9737eb0f94442c7ae4f9f5ffa0cc4659d5ccc3c6 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 20 Dec 2001 20:32:14 +0000 Subject: [PATCH] Revised ioctl/dmfs merge with fixes for bugs found in tests. --- tools/dmsetup.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/dmsetup.c b/tools/dmsetup.c index a2adb00a5..770e084aa 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -169,11 +169,17 @@ static int _info(int argc, char **argv) goto out; } - printf("state: %s\n", + printf("State: %s\n", info.suspended ? "SUSPENDED" : "ACTIVE"); - printf("open count: %d\n", info.open_count); - printf("major, minor: %d, %d\n", info.major, info.minor); - printf("number of targets: %d\n", info.target_count); + + if (info.open_count != -1) + printf("Open count: %d\n", info.open_count); + + printf("Major, minor: %d, %d\n", info.major, info.minor); + + if (info.target_count != -1) + printf("Number of targets: %d\n", info.target_count); + r = 1; out: