From 6fd87f845fc1947e5235890fa125a3f88b62a1b1 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 | 4 ++++ dmsetup/dmsetup.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index cca2e24..8d1b9ff 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -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/dmsetup/dmsetup.c b/dmsetup/dmsetup.c index d0278e0..c7ce16a 100644 --- a/dmsetup/dmsetup.c +++ b/dmsetup/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 || -- 2.43.5