summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-12-12 21:09:01 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-12-12 21:09:01 +0000
commit03ad38e16271dad45e4f47a75da50ea14d74a5c3 (patch)
tree8a28f3ca88b009cbcb7ec4d6957a0bc23e8d0474
parentb2590213ad1b934d667d67a80d4a4ff7c865a088 (diff)
(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.
-rw-r--r--term/users.c12
1 files changed, 12 insertions, 0 deletions
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)