From 8af2d4cf58e91344fec47648ab62b1e83e48ab44 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 29 Aug 1995 21:32:05 +0000 Subject: (open_hook): Use hurd_condition_wait to detect interrupts. --- trans/fifo.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'trans/fifo.c') diff --git a/trans/fifo.c b/trans/fifo.c index 6593be91..c160290f 100644 --- a/trans/fifo.c +++ b/trans/fifo.c @@ -160,14 +160,12 @@ open_hook (struct trivfs_peropen *po) { if (one_reader) /* Wait until there isn't any active fifo, so we can make one. */ - while (active_fifo != NULL || active_fifo->readers > 0) + while (!err && (active_fifo != NULL || active_fifo->readers > 0)) if (flags & O_NONBLOCK) - { - err = EWOULDBLOCK; - break; - } - else - condition_wait (&active_fifo_changed, &active_fifo_lock); + err = EWOULDBLOCK; + else if (hurd_condition_wait (&active_fifo_changed, + &active_fifo_lock)) + err = EINTR; if (!err && active_fifo == NULL) /* No other readers, and indeed, no fifo; make one. */ @@ -189,14 +187,12 @@ open_hook (struct trivfs_peropen *po) { if (wait_for_reader) /* Wait until there's a fifo to write to. */ - while (active_fifo == NULL || active_fifo->readers == 0) + while (!err && (active_fifo == NULL || active_fifo->readers == 0)) if (flags & O_NONBLOCK) - { - err = EWOULDBLOCK; - break; - } - else - condition_wait (&active_fifo_changed, &active_fifo_lock); + err = EWOULDBLOCK; + else if (hurd_condition_wait (&active_fifo_changed, + &active_fifo_lock)) + err = EINTR; if (!err && active_fifo == NULL) /* No other readers, and indeed, no fifo; make one. */ -- cgit v1.2.3