aboutsummaryrefslogtreecommitdiff
path: root/sbin/mdconfig/mdconfig.c
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2004-11-06 13:07:02 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2004-11-06 13:07:02 +0000
commit61a6eb62eced61a73dd4f961686cda2886c6215e (patch)
tree1082e170109a097c61a61bf73ce9f89781b9a66c /sbin/mdconfig/mdconfig.c
parentdc2c7965c0b6f70b55d5a99b8e873b2bf1d007b3 (diff)
downloadsrc-61a6eb62eced61a73dd4f961686cda2886c6215e.tar.gz
src-61a6eb62eced61a73dd4f961686cda2886c6215e.zip
For file backed md(4) devices output their source file via
'mdconfig -l -u <unit>'. Bump version number, as this change breaks ABI/API.
Notes
Notes: svn path=/head/; revision=137310
Diffstat (limited to 'sbin/mdconfig/mdconfig.c')
-rw-r--r--sbin/mdconfig/mdconfig.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index 8aa34ac184c6..083779d4affc 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);