diff options
author | Thomas Bushnell <thomas@gnu.org> | 1999-10-04 14:39:04 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1999-10-04 14:39:04 +0000 |
commit | 6edeb62e3980f1a3769ed74cb81567744b5b6e92 (patch) | |
tree | 22add65c288e7b6fccbae236ef56fabfddf194db /term/devio.c | |
parent | ffca5c4649a2808f523532728c4f1e9a0be0b912 (diff) |
1999-10-04 Thomas Bushnell, BSG <tb@mit.edu>
* term.h, devio.c, users.c: Revert previous change. Do it this
way instead:
* users.c (report_carrier_error): New function.
(carrier_error): New static global variable.
(open_hook): Deal with errors from carrier open.
* devio.c (device_open_reply): Move the !RETURNCODE case out of
the "initial open" case and use report_carrier_error.
* term.h (report_carrier_error): Declare new function.
Diffstat (limited to 'term/devio.c')
-rw-r--r-- | term/devio.c | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/term/devio.c b/term/devio.c index ce12b085..2306fa3b 100644 --- a/term/devio.c +++ b/term/devio.c @@ -500,32 +500,23 @@ device_open_reply (mach_port_t replyport, assert (open_pending != NOTPENDING); - if (open_pending == INITIAL) + if (returncode != 0) { - /* Special handling for the first open */ - - if (returncode != 0) - { - /* Note that DEVICE is total garbage (not a real port name at all!) - in this case. */ - - if (returncode == D_NO_SUCH_DEVICE) - /* Record that the device does not exist. */ - termflags |= NO_DEVICE; + report_carrier_error (returncode); - /* Bogus. */ - report_carrier_on (); - report_carrier_off (); + mach_port_deallocate (mach_task_self (), phys_reply); + phys_reply = MACH_PORT_NULL; + ports_port_deref (phys_reply_pi); + phys_reply_pi = 0; - mach_port_deallocate (mach_task_self (), phys_reply); - phys_reply = MACH_PORT_NULL; - ports_port_deref (phys_reply_pi); - phys_reply_pi = 0; + open_pending = NOTPENDING; + mutex_unlock (&global_lock); + return 0; + } - open_pending = NOTPENDING; - mutex_unlock (&global_lock); - return 0; - } + if (open_pending == INITIAL) + { + /* Special handling for the first open */ assert (phys_device == MACH_PORT_NULL); assert (phys_reply_writes == MACH_PORT_NULL); |