From 03ad38e16271dad45e4f47a75da50ea14d74a5c3 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 12 Dec 1995 21:09:01 +0000 Subject: (po_create_hook): If this is the pty, then call pty specific function. (po_destroy_hook): Likewise. (pi_create_hook): Don't do anything for pty. (pi_destroy_hook): Likewise. --- term/users.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'term') diff --git a/term/users.c b/term/users.c index 0c823df2..886d245d 100644 --- a/term/users.c +++ b/term/users.c @@ -160,6 +160,9 @@ error_t (*trivfs_check_open_hook) (struct trivfs_control *, uid_t *, static error_t pi_create_hook (struct trivfs_protid *cred) { + if (cred->pi.class == pty_class) + return 0; + mutex_lock (&global_lock); if (cred->hook) ((struct protid_hook *)cred->hook)->refcnt++; @@ -172,6 +175,9 @@ error_t (*trivfs_protid_create_hook) (struct trivfs_protid *) = pi_create_hook; static void pi_destroy_hook (struct trivfs_protid *cred) { + if (cred->pi.class == pty_class) + return 0; + mutex_lock (&global_lock); if (cred->hook && !--((struct protid_hook *)cred->hook)->refcnt) free (cred->hook); @@ -182,6 +188,9 @@ void (*trivfs_protid_destroy_hook) (struct trivfs_protid *) = pi_destroy_hook; static error_t po_create_hook (struct trivfs_peropen *po) { + if (po->cntl == ptyctl) + return pty_po_create_hook (po); + mutex_lock (&global_lock); nperopens++; if (po->openmodes & O_ASYNC) @@ -195,6 +204,9 @@ error_t (*trivfs_peropen_create_hook) (struct trivfs_peropen *) = static void po_destroy_hook (struct trivfs_peropen *po) { + if (po->cntl == ptyctl) + return pty_po_destroy_hook (po); + mutex_lock (&global_lock); nperopens--; if (!nperopens) -- cgit v1.2.3