diff options
author | lulf <lulf@FreeBSD.org> | 2009-04-10 08:50:14 +0000 |
---|---|---|
committer | lulf <lulf@FreeBSD.org> | 2009-04-10 08:50:14 +0000 |
commit | 62687638dfa1347290a308e562153a2314cbd8fa (patch) | |
tree | dbef804cce038f6daa1d9598a974dc10f18afecf /sbin | |
parent | fbd36468425151a258c7a90df46c0de1a069a137 (diff) | |
download | FreeBSD-src-62687638dfa1347290a308e562153a2314cbd8fa.zip FreeBSD-src-62687638dfa1347290a308e562153a2314cbd8fa.tar.gz |
- Move out allocation part of different gvinum objects into its own routine and
make use of it in the gvinum userland code.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/gvinum/gvinum.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sbin/gvinum/gvinum.c b/sbin/gvinum/gvinum.c index bea4f7c..b867fd4 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)); |