From 33aa253159566380e2d2312ca1ac0030f236cd13 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 19 Nov 1996 22:42:08 +0000 Subject: (diskfs_S_file_get_translator_cntl): Use MACH_MSG_TYPE_MOVE_SEND to return *ctl, rather than COPY. Correctly test for errors from fshelp_fetch_control. --- libdiskfs/file-get-transcntl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libdiskfs/file-get-transcntl.c b/libdiskfs/file-get-transcntl.c index 4eb78992..528529fb 100644 --- a/libdiskfs/file-get-transcntl.c +++ b/libdiskfs/file-get-transcntl.c @@ -33,13 +33,16 @@ diskfs_S_file_get_translator_cntl (struct protid *cred, np = cred->po->np; mutex_lock (&np->lock); + error = fshelp_isowner (&np->dn_stat, cred->user); if (!error) error = fshelp_fetch_control (&np->transbox, ctl); - if (ctl == MACH_PORT_NULL) + if (!error && *ctl == MACH_PORT_NULL) error = ENXIO; if (!error) - *ctltype = MACH_MSG_TYPE_COPY_SEND; + *ctltype = MACH_MSG_TYPE_MOVE_SEND; + mutex_unlock (&np->lock); + return error; } -- cgit v1.2.3