diff options
author | Miles Bader <miles@gnu.org> | 1995-12-21 16:57:47 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-12-21 16:57:47 +0000 |
commit | 68d84e512d5bc81bc33ecb0612eae86edb4389e0 (patch) | |
tree | 7f8c077851d03ad64aa71a42bbb9564a7f85d413 | |
parent | 6438ee5e4b458963d66b5cf76f9ec50d7174aef8 (diff) |
(S_term_get_nodename, S_term_set_nodename):
Get the node name from our cred->po->cntl->hook rather than NODENAME.
-rw-r--r-- | term/users.c | 14 |
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 |