summaryrefslogtreecommitdiff
path: root/term/users.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1996-10-24 19:30:48 +0000
committerThomas Bushnell <thomas@gnu.org>1996-10-24 19:30:48 +0000
commitd3be92a4e59b7efd4b6086e04144acf37819d3b7 (patch)
tree9cd8aef91fe93d975df3616a996d53bbe0bd2d01 /term/users.c
parent09699519abd25a24edd20efda0e24838f272db0b (diff)
Thu Oct 24 14:44:57 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* users.c (open_hook): Always assert DTR (even if O_NONBLOCK). Don't return any errors if O_NONBLOCK and we don't have carrier.
Diffstat (limited to 'term/users.c')
-rw-r--r--term/users.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/term/users.c b/term/users.c
index d438980e..0350b13a 100644
--- a/term/users.c
+++ b/term/users.c
@@ -143,10 +143,8 @@ open_hook (struct trivfs_control *cntl,
return EBUSY;
}
- /* Wait for carrier to turn on. */
- while (((termflags & NO_CARRIER) && !(termstate.c_cflag & CLOCAL))
- && !(flags & O_NONBLOCK)
- && !cancel)
+ /* Assert DTR if necessary. */
+ if ((termflags & NO_CARRIER) && !(termstate.c_cflag & CLOCAL))
{
err = (*bottom->assert_dtr) ();
if (err)
@@ -154,14 +152,14 @@ open_hook (struct trivfs_control *cntl,
mutex_unlock (&global_lock);
return err;
}
- cancel = hurd_condition_wait (&carrier_alert, &global_lock);
}
+
+ /* Wait for carrier to turn on. */
+ while (((termflags & NO_CARRIER) && !(termstate.c_cflag & CLOCAL))
+ && !(flags & O_NONBLOCK)
+ && !cancel)
+ cancel = hurd_condition_wait (&carrier_alert, &global_lock);
- if ((termflags & NO_CARRIER) && !(termstate.c_cflag & CLOCAL))
- {
- mutex_unlock (&global_lock);
- return EWOULDBLOCK;
- }
if (cancel)
{
mutex_unlock (&global_lock);