summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-07-18 20:12:14 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-07-18 20:12:14 +0000
commit585b7abf4adb8c30bfc4398ae8d239a42b27d885 (patch)
tree301e0cf65ee236624225ac44eb478987cd470798 /libdiskfs
parentc5799e004a4b2aef66578630b565cff3da2830f2 (diff)
(diskfs_S_file_get_translator): Conform to new memory semantic of
diskfs_get_translator.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/file-get-trans.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libdiskfs/file-get-trans.c b/libdiskfs/file-get-trans.c
index 0447666f..c2680426 100644
--- a/libdiskfs/file-get-trans.c
+++ b/libdiskfs/file-get-trans.c
@@ -114,7 +114,20 @@ diskfs_S_file_get_translator (struct protid *cred,
if (!np->istranslated)
error = EINVAL;
else
- error = diskfs_get_translator (np, trans, translen);
+ {
+ char *string;
+ u_int len;
+ error = diskfs_get_translator (np, &string, &len);
+ if (!error)
+ {
+ if (len > *translen)
+ vm_allocate (mach_task_self (), (vm_address_t *) trans,
+ len, 1);
+ bcopy (string, *trans, len);
+ *translen = len;
+ free (string);
+ }
+ }
}
mutex_unlock (&np->lock);