summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-06-21 05:57:14 +0000
committerMiles Bader <miles@gnu.org>1996-06-21 05:57:14 +0000
commita05664455d6949646612790778525662fc03cc1b (patch)
tree180b15f421c8b26013982fa4d7f3a582bf4c708e /libdiskfs
parent570575380f8a77dcc2ac53ae51dad48d69c33d49 (diff)
(diskfs_S_fsys_get_options):
Use fshelp_return_malloced_buffer to setup the return data.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/fsys-options.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/libdiskfs/fsys-options.c b/libdiskfs/fsys-options.c
index c69dd43d..5a8b681f 100644
--- a/libdiskfs/fsys-options.c
+++ b/libdiskfs/fsys-options.c
@@ -89,6 +89,7 @@ diskfs_S_fsys_get_options (fsys_t fsys,
char **data, mach_msg_type_number_t *data_len)
{
char *argz;
+ size_t argz_len;
error_t err;
struct port_info *port =
ports_lookup_port (diskfs_port_bucket, fsys, diskfs_control_class);
@@ -97,18 +98,12 @@ diskfs_S_fsys_get_options (fsys_t fsys,
return EOPNOTSUPP;
rwlock_reader_lock (&diskfs_fsys_lock);
- err = diskfs_get_options (&argz, data_len);
+ err = diskfs_get_options (&argz, &argz_len);
rwlock_reader_unlock (&diskfs_fsys_lock);
- if (!err)
+ if (! err)
/* Move ARGZ from a malloced buffer into a vm_alloced one. */
- {
- err =
- vm_allocate (mach_task_self (), (vm_address_t *)data, *data_len, 1);
- if (!err)
- bcopy (argz, *data, *data_len);
- free (argz);
- }
+ err = fshelp_return_malloced_buffer (argz, argz_len, data, data_len);
ports_port_deref (port);
return err;