diff options
author | Alasdair G Kergon <agk@redhat.com> | 2017-10-26 17:47:13 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2017-10-26 17:47:13 +0100 |
commit | 4b0f6829f63d36b473f6670a41ac7521ff82674d (patch) | |
tree | 150142c8ba082d30f50da1a29a8de776b90cc43e | |
parent | fdcc709ed0e5051f471ee64ac51f6c8e2ed941fc (diff) | |
download | lvm2-4b0f6829f63d36b473f6670a41ac7521ff82674d.tar.gz |
dmsetup: Add unknown device error to dmsetup status.
Treat status the same way as info if provided device name doesn't exist.
-rw-r--r-- | WHATS_NEW_DM | 1 | ||||
-rw-r--r-- | tools/dmsetup.c | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index b0dd01bcd..6475fbdba 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.145 - =================================== + Issue a specific error with dmsetup status if device is unknown. Fix RT_LIBS reference in generated libdevmapper.pc for pkg-config Version 1.02.144 - 6th October 2017 diff --git a/tools/dmsetup.c b/tools/dmsetup.c index 661910f74..53097b38b 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -2431,9 +2431,14 @@ static int _status(CMD_ARGS) if (!_task_run(dmt)) goto_out; - if (!dm_task_get_info(dmt, &info) || !info.exists) + if (!dm_task_get_info(dmt, &info)) goto_out; + if (!info.exists) { + fprintf(stderr, "Device does not exist.\n"); + goto_out; + } + if (!name) name = dm_task_get_name(dmt); |