summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-01-27 16:33:58 +0000
committerMiles Bader <miles@gnu.org>1996-01-27 16:33:58 +0000
commitdbfeb5554bddcea8677e11c110bf1f9598aa5052 (patch)
tree89793d7751d6755c48dc70cd7a01f08f3d1fa728
parent3512fe0b86990b27c72d4a8c04402f804c42bc48 (diff)
(diskfs_S_io_duplicate): Use diskfs_create_protid instead of
diskfs_make_protid, and deal with an error return.
-rw-r--r--libdiskfs/io-duplicate.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/libdiskfs/io-duplicate.c b/libdiskfs/io-duplicate.c
index d64dc600..addefc48 100644
--- a/libdiskfs/io-duplicate.c
+++ b/libdiskfs/io-duplicate.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1994, 1995 Free Software Foundation
+ Copyright (C) 1994, 1995, 1996 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -24,17 +24,24 @@ diskfs_S_io_duplicate (struct protid *cred,
mach_port_t *port,
mach_msg_type_name_t *portpoly)
{
+ error_t err;
struct protid *newpi;
if (!cred)
return EOPNOTSUPP;
mutex_lock (&cred->po->np->lock);
- newpi = diskfs_make_protid (cred->po, cred->uids, cred->nuids,
- cred->gids, cred->ngids);
- *port = ports_get_right (newpi);
- *portpoly = MACH_MSG_TYPE_MAKE_SEND;
- ports_port_deref (newpi);
+
+ err = diskfs_create_protid (cred->po, cred->uids, cred->nuids,
+ cred->gids, cred->ngids, &newpi);
+ if (! err)
+ {
+ *port = ports_get_right (newpi);
+ *portpoly = MACH_MSG_TYPE_MAKE_SEND;
+ ports_port_deref (newpi);
+ }
+
mutex_unlock (&cred->po->np->lock);
- return 0;
+
+ return err;
}