diff options
author | pjd <pjd@FreeBSD.org> | 2004-11-06 13:07:02 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-11-06 13:07:02 +0000 |
commit | d18ec52c7546f2c9d388a7ea50c53e7fe5c40659 (patch) | |
tree | 1082e170109a097c61a61bf73ce9f89781b9a66c /sbin/mdconfig | |
parent | 2b775a8633a9fd57b9fe564ed98292d3b7fac655 (diff) | |
download | FreeBSD-src-d18ec52c7546f2c9d388a7ea50c53e7fe5c40659.zip FreeBSD-src-d18ec52c7546f2c9d388a7ea50c53e7fe5c40659.tar.gz |
For file backed md(4) devices output their source file via
'mdconfig -l -u <unit>'.
Bump version number, as this change breaks ABI/API.
Diffstat (limited to 'sbin/mdconfig')
-rw-r--r-- | sbin/mdconfig/mdconfig.c | 9 |
1 files changed, 7 insertions, 2 deletions
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); |