diff options
author | Thomas Bushnell <thomas@gnu.org> | 1996-10-24 19:30:48 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1996-10-24 19:30:48 +0000 |
commit | d3be92a4e59b7efd4b6086e04144acf37819d3b7 (patch) | |
tree | 9cd8aef91fe93d975df3616a996d53bbe0bd2d01 /term | |
parent | 09699519abd25a24edd20efda0e24838f272db0b (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')
-rw-r--r-- | term/ChangeLog | 5 | ||||
-rw-r--r-- | term/users.c | 18 |
2 files changed, 13 insertions, 10 deletions
diff --git a/term/ChangeLog b/term/ChangeLog index b01808e7..8536ff51 100644 --- a/term/ChangeLog +++ b/term/ChangeLog @@ -1,3 +1,8 @@ +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. + Tue Oct 8 22:46:09 1996 Miles Bader <miles@gnu.ai.mit.edu> * users.c (open_hook): Zero WINDOW_SIZE during initialization. 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); |