diff options
author | Neil Brown <neilb@suse.de> | 2003-03-02 23:11:38 +0000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2003-03-02 23:11:38 +0000 |
commit | d013a55e9422f251ce92decfbf39336064fd6c27 (patch) | |
tree | b616a43f27f2a021f02d0474742c80191ba94a95 /Detail.c | |
parent | 5787fa490612387a43c1897eb807b0c5612b5cd2 (diff) | |
download | mdadm-d013a55e9422f251ce92decfbf39336064fd6c27.tar.gz mdadm-d013a55e9422f251ce92decfbf39336064fd6c27.tar.xz mdadm-d013a55e9422f251ce92decfbf39336064fd6c27.zip |
mdadm-1.1.0mdadm-1.1.0
Diffstat (limited to 'Detail.c')
-rw-r--r-- | Detail.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -44,6 +44,7 @@ int Detail(char *dev, int brief) int d; time_t atime; char *c; + char *devices = NULL; mdp_super_t super; int have_super = 0; @@ -163,7 +164,15 @@ int Detail(char *dev, int brief) if (disk.state & (1<<MD_DISK_REMOVED)) printf(" removed"); } if ((dv=map_dev(disk.major, disk.minor))) { - if (!brief) printf(" %s", dv); + if (brief) { + if (devices) { + devices = realloc(devices, + strlen(devices)+1+strlen(dv)+1); + strcat(strcat(devices,","),dv); + } else + devices = strdup(dv); + } else + printf(" %s", dv); if (!have_super && (disk.state & (1<<MD_DISK_ACTIVE))) { /* try to read the superblock from this device * to get more info @@ -189,6 +198,7 @@ int Detail(char *dev, int brief) if (!brief) printf("\n Events : %d.%d\n", super.events_hi, super.events_lo); } + if (brief && devices) printf("\n devices=%s", devices); if (brief) printf("\n"); return 0; } |