summaryrefslogtreecommitdiff
path: root/trans/fifo.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-08-29 21:32:05 +0000
committerMiles Bader <miles@gnu.org>1995-08-29 21:32:05 +0000
commit8af2d4cf58e91344fec47648ab62b1e83e48ab44 (patch)
treeebfcefd260d9486c3baa3fa5254e70805e3631c9 /trans/fifo.c
parentfd2b487ec663b9a4434b2d000b7f4d76e8ab30b5 (diff)
(open_hook): Use hurd_condition_wait to detect interrupts.
Diffstat (limited to 'trans/fifo.c')
-rw-r--r--trans/fifo.c24
1 files changed, 10 insertions, 14 deletions
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. */