summaryrefslogtreecommitdiffstats
path: root/super0.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-05-19 07:13:03 +0000
committerNeil Brown <neilb@suse.de>2006-05-19 07:13:03 +0000
commitb6750aa8da57bfc0eb3a3bdc47c289638b1022c8 (patch)
treefadb26de92f6cd4c8ca07064133250b9fb47a32d /super0.c
parent05697ec1e26eadc2f814d9f84f8c783fff5b98b5 (diff)
downloadmdadm-b6750aa8da57bfc0eb3a3bdc47c289638b1022c8.tar.gz
mdadm-b6750aa8da57bfc0eb3a3bdc47c289638b1022c8.tar.xz
mdadm-b6750aa8da57bfc0eb3a3bdc47c289638b1022c8.zip
Include homehost information in --detail where appropriate.
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'super0.c')
-rw-r--r--super0.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/super0.c b/super0.c
index 7fe2336..d1fbfae 100644
--- a/super0.c
+++ b/super0.c
@@ -231,7 +231,7 @@ static void brief_examine_super0(void *sbv)
printf("\n");
}
-static void detail_super0(void *sbv)
+static void detail_super0(void *sbv, char *homehost)
{
mdp_super_t *sb = sbv;
printf(" UUID : ");
@@ -240,6 +240,13 @@ static void detail_super0(void *sbv)
sb->set_uuid2, sb->set_uuid3);
else
printf("%08x", sb->set_uuid0);
+ if (homehost) {
+ unsigned char *hash = SHA1((unsigned char *)homehost,
+ strlen(homehost),
+ NULL);
+ if (memcmp(&sb->set_uuid2, hash, 8)==0)
+ printf(" (local to host %s)", homehost);
+ }
printf("\n Events : %d.%d\n\n", sb->events_hi, sb->events_lo);
}