diff options
Diffstat (limited to 'term/users.c')
-rw-r--r-- | term/users.c | 18 |
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); |