From 7666ed57d11b58953a9be6ae4b81180bade1faaf Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Fri, 29 Jul 2005 16:11:23 +0000 Subject: [PATCH] Fix dmsetup ls -j and status --target with empty table. --- WHATS_NEW_DM | 4 ++++ tools/dmsetup.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index cca2e24fb..8d1b9ffad 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,3 +1,7 @@ +Version 1.01.04 +============================= + Fix dmsetup ls -j and status --target with empty table. + Version 1.01.03 - 13 Jun 2005 ============================= Use matchpathcon mode parameter. diff --git a/tools/dmsetup.c b/tools/dmsetup.c index d0278e08f..c7ce16a4e 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -757,13 +757,16 @@ static int _status(int argc, char **argv, void *data) if (!dm_task_run(dmt)) goto out; + if (!name) + name = (char *) dm_task_get_name(dmt); + /* Fetch targets and print 'em */ do { next = dm_get_next_target(dmt, next, &start, &length, &target_type, ¶ms); /* Skip if target type doesn't match */ - if (_switches[TARGET_ARG] && target_type && - strcmp(target_type, _target)) + if (_switches[TARGET_ARG] && + (!target_type || strcmp(target_type, _target))) continue; if (ls_only) { if (!_switches[EXEC_ARG] || !_command ||