summaryrefslogtreecommitdiff
path: root/term/users.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-03-02 21:08:16 +0000
committerMiles Bader <miles@gnu.org>1997-03-02 21:08:16 +0000
commitc93b79b41d410e5e5dbba24a18bb744a456b3852 (patch)
tree83109d598486ede21f7a418015835122211770bd /term/users.c
parentd2b28d588e33c2352fb57fc2d77504a6027e43d8 (diff)
(open_hook):
Add OPEN_COUNT hack to try and detect lossage.
Diffstat (limited to 'term/users.c')
-rw-r--r--term/users.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/term/users.c b/term/users.c
index 99191439..42f6ae35 100644
--- a/term/users.c
+++ b/term/users.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
Written by Michael I. Bushnell, p/BSG.
This file is part of the GNU Hurd.
@@ -108,6 +108,7 @@ open_hook (struct trivfs_control *cntl,
struct iouser *user,
int flags)
{
+ static int open_count = 0; /* XXX debugging */
int cancel = 0;
error_t err;
@@ -137,12 +138,22 @@ open_hook (struct trivfs_control *cntl,
termflags |= NO_OWNER;
}
- else if (termflags & EXCL_USE)
+ else
{
- mutex_unlock (&global_lock);
- return EBUSY;
+ assert (open_count > 0); /* XXX debugging */
+
+ if (termflags & EXCL_USE)
+ {
+ mutex_unlock (&global_lock);
+ return EBUSY;
+ }
}
+ open_count++; /* XXX debugging */
+
+ /* XXX debugging */
+ assert (! (termstate.c_oflag & OTILDE));
+
/* Assert DTR if necessary. */
if ((termflags & NO_CARRIER) && !(termstate.c_cflag & CLOCAL))
{