From d3be92a4e59b7efd4b6086e04144acf37819d3b7 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Thu, 24 Oct 1996 19:30:48 +0000 Subject: Thu Oct 24 14:44:57 1996 Thomas Bushnell, n/BSG * 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. --- term/ChangeLog | 5 +++++ term/users.c | 18 ++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'term') 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 + + * 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 * 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); -- cgit v1.2.3