diff options
author | Miles Bader <miles@gnu.org> | 1996-11-19 22:42:08 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-11-19 22:42:08 +0000 |
commit | 33aa253159566380e2d2312ca1ac0030f236cd13 (patch) | |
tree | 5b9fdb91654a1e3091e7a53e8cabaec4b2fe03b0 | |
parent | ae635e83d31faa0e99788278c4b11bdc7eb8bb21 (diff) |
(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.
-rw-r--r-- | libdiskfs/file-get-transcntl.c | 7 |
1 files 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; } |