summaryrefslogtreecommitdiff
path: root/term/hurdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'term/hurdio.c')
-rw-r--r--term/hurdio.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/term/hurdio.c b/term/hurdio.c
index 2dfbacef..ef34740b 100644
--- a/term/hurdio.c
+++ b/term/hurdio.c
@@ -243,26 +243,11 @@ hurdio_writer_loop (any_t arg)
{
while (writer_thread != MACH_PORT_NULL
&& (ioport == MACH_PORT_NULL || !qsize (outputq)
- || (termflags & USER_OUTPUT_SUSP)))
+ || output_stopped))
hurd_condition_wait (&hurdio_writer_condition, &global_lock);
if (writer_thread == MACH_PORT_NULL) /* A sign to die. */
return 0;
- /* If the output was suspended earlier, we have to tell the
- underlying port to resume it. */
- if (output_stopped)
- {
- if (tioc_caps & TIOC_CAP_START)
- {
- err = tioctl_tiocstart (ioport);
- if (err && (err == EMIG_BAD_ID || err == EOPNOTSUPP))
- tioc_caps &= ~TIOC_CAP_START;
- /* XXX Handle the error. */
- err = 0;
- }
- output_stopped = 0;
- }
-
/* Copy characters onto PENDING_OUTPUT, not bothering
those already there. */
size = qsize (outputq);
@@ -323,6 +308,18 @@ hurdio_writer_loop (any_t arg)
static error_t
hurdio_start_output ()
{
+ /* If the output was suspended earlier and not anymore, we have to
+ tell the underlying port to resume it. */
+ if (output_stopped && !(termflags & USER_OUTPUT_SUSP))
+ {
+ if (tioc_caps & TIOC_CAP_START)
+ {
+ error_t err = tioctl_tiocstart (ioport);
+ if (err && (err == EMIG_BAD_ID || err == EOPNOTSUPP))
+ tioc_caps &= ~TIOC_CAP_START;
+ }
+ output_stopped = 0;
+ }
condition_broadcast (&hurdio_writer_condition);
return 0;
}