diff options
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); |