summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/file-get-fs-opts.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/libdiskfs/file-get-fs-opts.c b/libdiskfs/file-get-fs-opts.c
index d8d2bca9..662e7511 100644
--- a/libdiskfs/file-get-fs-opts.c
+++ b/libdiskfs/file-get-fs-opts.c
@@ -1,6 +1,6 @@
/* Get run-time file system options
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -30,23 +30,18 @@ diskfs_S_file_get_fs_options (struct protid *cred,
{
error_t err;
char *argz;
+ size_t argz_len;
- if (!cred)
+ if (! cred)
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);
return err;
}