From 5628024d45442120c365b17da2b638760a150f55 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 7 Jul 2009 16:36:05 +0000 Subject: [PATCH] Fix whitespace in linear target line to fix identical table line detection. (only tested with linear so far) --- libdm/libdm-deptree.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c index 648c0080a..5c5ea97f2 100644 --- a/libdm/libdm-deptree.c +++ b/libdm/libdm-deptree.c @@ -1252,12 +1252,16 @@ static int _emit_areas_line(struct dm_task *dmt __attribute((unused)), { struct seg_area *area; char devbuf[DM_FORMAT_DEV_BUFSIZE]; + unsigned first_time = 1; dm_list_iterate_items(area, &seg->areas) { if (!_build_dev_string(devbuf, sizeof(devbuf), area->dev_node)) return_0; - EMIT_PARAMS(*pos, " %s %" PRIu64, devbuf, area->offset); + EMIT_PARAMS(*pos, "%s%s %" PRIu64, first_time ? "" : " ", + devbuf, area->offset); + + first_time = 0; } return 1; @@ -1320,7 +1324,7 @@ static int _emit_segment_line(struct dm_task *dmt, uint32_t major, if ((seg->flags & DM_BLOCK_ON_ERROR)) EMIT_PARAMS(pos, " block_on_error"); - EMIT_PARAMS(pos, " %u", seg->mirror_area_count); + EMIT_PARAMS(pos, " %u ", seg->mirror_area_count); break; case SEG_SNAPSHOT: @@ -1337,10 +1341,10 @@ static int _emit_segment_line(struct dm_task *dmt, uint32_t major, EMIT_PARAMS(pos, "%s", originbuf); break; case SEG_STRIPED: - EMIT_PARAMS(pos, "%u %u", seg->area_count, seg->stripe_size); + EMIT_PARAMS(pos, "%u %u ", seg->area_count, seg->stripe_size); break; case SEG_CRYPT: - EMIT_PARAMS(pos, "%s%s%s%s%s %s %" PRIu64, seg->cipher, + EMIT_PARAMS(pos, "%s%s%s%s%s %s %" PRIu64 " ", seg->cipher, seg->chainmode ? "-" : "", seg->chainmode ?: "", seg->iv ? "-" : "", seg->iv ?: "", seg->key, seg->iv_offset != DM_CRYPT_IV_DEFAULT ?