aboutsummaryrefslogtreecommitdiff
path: root/sbin/mdconfig/mdconfig.c
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2004-12-27 17:20:06 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2004-12-27 17:20:06 +0000
commit88b5b78d59c69968024c810165c41993e4aeaf40 (patch)
tree55fe765c8368400583f00b5c70626fe1601950c0 /sbin/mdconfig/mdconfig.c
parent77fc70c1ef77621036c7961affca175a193a4ca0 (diff)
downloadsrc-88b5b78d59c69968024c810165c41993e4aeaf40.tar.gz
src-88b5b78d59c69968024c810165c41993e4aeaf40.zip
Rewrite piece of code which I committed some time ago that allows to
show file name for 'mdconfig -l -u <x>' command. This allows to preserve API/ABI compatibility with version 0 (that's why I changed version number back to 0) and will allow to merge this change to RELENG_5. MFC after: 5 days
Notes
Notes: svn path=/head/; revision=139359
Diffstat (limited to 'sbin/mdconfig/mdconfig.c')
-rw-r--r--sbin/mdconfig/mdconfig.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index d4cca40b1e49..0e6d81804e20 100644
--- a/sbin/mdconfig/mdconfig.c
+++ b/sbin/mdconfig/mdconfig.c
@@ -60,6 +60,10 @@ main(int argc, char **argv)
int cmdline = 0;
bzero(&mdio, sizeof(mdio));
+ mdio.md_file = malloc(PATH_MAX);
+ if (mdio.md_file == NULL)
+ err(1, "could not allocate memory");
+ bzero(mdio.md_file, PATH_MAX);
for (;;) {
ch = getopt(argc, argv, "ab:df:lno:s:S:t:u:x:y:");
if (ch == -1)
@@ -223,7 +227,7 @@ main(int argc, char **argv)
if (mdio.md_mediasize == 0)
errx(1, "must specify -s for -t malloc or -t swap");
if (cmdline == 2 && mdio.md_type == MD_VNODE)
- if (mdio.md_file == NULL)
+ if (mdio.md_file[0] == '\0')
errx(1, "must specify -f for -t vnode");
if (action == LIST) {
if (mdio.md_options & MD_AUTOUNIT)