aboutsummaryrefslogtreecommitdiff
path: root/sbin/gvinum/gvinum.c
diff options
context:
space:
mode:
authorUlf Lilleengen <lulf@FreeBSD.org>2009-04-10 08:50:14 +0000
committerUlf Lilleengen <lulf@FreeBSD.org>2009-04-10 08:50:14 +0000
commit1de45ea74d78e613420e66917a1ba1190fbf657d (patch)
treedbef804cce038f6daa1d9598a974dc10f18afecf /sbin/gvinum/gvinum.c
parent80cb9f211a1bb8f64e944d238772ff7b355e3f13 (diff)
downloadsrc-1de45ea74d78e613420e66917a1ba1190fbf657d.tar.gz
src-1de45ea74d78e613420e66917a1ba1190fbf657d.zip
- Move out allocation part of different gvinum objects into its own routine and
make use of it in the gvinum userland code.
Notes
Notes: svn path=/head/; revision=190881
Diffstat (limited to 'sbin/gvinum/gvinum.c')
-rw-r--r--sbin/gvinum/gvinum.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/gvinum/gvinum.c b/sbin/gvinum/gvinum.c
index bea4f7c0c216..b867fd4ef7a9 100644
--- a/sbin/gvinum/gvinum.c
+++ b/sbin/gvinum/gvinum.c
@@ -433,10 +433,9 @@ create_drive(char *device)
req = gctl_get_handle();
gctl_ro_param(req, "class", -1, "VINUM");
gctl_ro_param(req, "verb", -1, "create");
- d = malloc(sizeof(struct gv_drive));
+ d = gv_alloc_drive();
if (d == NULL)
err(1, "unable to allocate for gv_drive object");
- memset(d, 0, sizeof(struct gv_drive));
strlcpy(d->name, drivename, sizeof(d->name));
strlcpy(d->device, device, sizeof(d->device));