From b6750aa8da57bfc0eb3a3bdc47c289638b1022c8 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 19 May 2006 07:13:03 +0000 Subject: Include homehost information in --detail where appropriate. Signed-off-by: Neil Brown --- super1.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'super1.c') diff --git a/super1.c b/super1.c index a29795a..77118d4 100644 --- a/super1.c +++ b/super1.c @@ -317,13 +317,18 @@ static void brief_examine_super1(void *sbv) printf("\n"); } -static void detail_super1(void *sbv) +static void detail_super1(void *sbv, char *homehost) { struct mdp_superblock_1 *sb = sbv; int i; - - printf(" Name : %.32s\n", sb->set_name); - printf(" UUID : "); + int l = homehost ? strlen(homehost) : 0; + + printf(" Name : %.32s", sb->set_name); + if (l > 0 && l < 32 && + sb->set_name[l] == ':' && + strncmp(sb->set_name, homehost, l) == 0) + printf(" (local to host %s)", homehost); + printf("\n UUID : "); for (i=0; i<16; i++) { if ((i&3)==0 && i != 0) printf(":"); printf("%02x", sb->set_uuid[i]); -- cgit