From d18ec52c7546f2c9d388a7ea50c53e7fe5c40659 Mon Sep 17 00:00:00 2001 From: pjd Date: Sat, 6 Nov 2004 13:07:02 +0000 Subject: For file backed md(4) devices output their source file via 'mdconfig -l -u '. Bump version number, as this change breaks ABI/API. --- sbin/mdconfig/mdconfig.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sbin') diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c index 8aa34ac..083779d4 100644 --- a/sbin/mdconfig/mdconfig.c +++ b/sbin/mdconfig/mdconfig.c @@ -115,8 +115,11 @@ main(int argc, char **argv) mdio.md_options = MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; cmdline = 2; } - mdio.md_file = optarg; - fd = open(optarg, O_RDONLY); + if (realpath(optarg, mdio.md_file) == NULL) { + err(1, "could not find full path for %s", + optarg); + } + fd = open(mdio.md_file, O_RDONLY); if (fd < 0) err(1, "could not open %s", optarg); else if (mdio.md_mediasize == 0) { @@ -300,6 +303,8 @@ query(const int fd, const int unit) } printf("\t"); prthumanval(mdio.md_mediasize); + if (mdio.md_type == MD_VNODE) + printf("\t%s", mdio.md_file); printf("\n"); return (0); -- cgit v1.1