summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--term/users.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/term/users.c b/term/users.c
index 1c8cf4b8..450640be 100644
--- a/term/users.c
+++ b/term/users.c
@@ -1856,7 +1856,7 @@ S_term_get_nodename (io_t arg,
if (!cred)
return EOPNOTSUPP;
- strcpy (name, nodename);
+ strcpy (name, (char *)cred->po->cntl->hook ?: "");
ports_port_deref (cred);
return 0;
@@ -1866,16 +1866,16 @@ kern_return_t
S_term_set_nodename (io_t arg,
char *name)
{
- struct trivfs_protid *cred = ports_lookup_port (term_bucket, arg,
- tty_class);
+ error_t err = 0;
+ struct trivfs_protid *cred = ports_lookup_port (term_bucket, arg, tty_class);
if (!cred)
return EOPNOTSUPP;
- ports_port_deref (cred);
- if (strcmp (name, nodename))
- return EINVAL;
+ if (strcmp (name, (char *)cred->po->cntl->hook) != 0)
+ err = EINVAL;
- return 0;
+ ports_port_deref (cred);
+ return err;
}
kern_return_t