From 68d84e512d5bc81bc33ecb0612eae86edb4389e0 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 21 Dec 1995 16:57:47 +0000 Subject: (S_term_get_nodename, S_term_set_nodename): Get the node name from our cred->po->cntl->hook rather than NODENAME. --- term/users.c | 14 +++++++------- 1 file 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 -- cgit v1.2.3