From caf7ac6e90416c95f67a381835980e3da3570eb0 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 20 Oct 1998 09:48:26 +0000 Subject: Add braces to silence gcc warnings. --- trans/new-fifo.c | 62 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 28 deletions(-) (limited to 'trans/new-fifo.c') diff --git a/trans/new-fifo.c b/trans/new-fifo.c index 9266b1e5..203a7d4d 100644 --- a/trans/new-fifo.c +++ b/trans/new-fifo.c @@ -245,16 +245,18 @@ fifo_trans_open (struct fifo_trans *trans, int flags, void **hook) mutex_lock (&trans->active_fifo_lock); /* Wait until the active fifo has changed so that CONDITION is true. */ -#define WAIT(condition, noblock_err) \ - while (!err && !(condition)) \ - if (flags & O_NONBLOCK) \ - { \ - err = noblock_err; \ - break; \ - } \ - else if (hurd_condition_wait (&trans->active_fifo_changed, \ - &trans->active_fifo_lock)) \ - err = EINTR; +#define WAIT(condition, noblock_err) \ + while (!err && !(condition)) \ + { \ + if (flags & O_NONBLOCK) \ + { \ + err = noblock_err; \ + break; \ + } \ + else if (hurd_condition_wait (&trans->active_fifo_changed, \ + &trans->active_fifo_lock)) \ + err = EINTR; \ + } if (flags & O_READ) /* When opening for read, what we do depends on what mode this server @@ -600,26 +602,30 @@ trivfs_S_io_select (struct trivfs_protid *cred, pipe = cred->po->hook; if (*select_type & SELECT_READ) - if (cred->po->openmodes & O_READ) - { - mutex_lock (&pipe->lock); - if (pipe_wait_readable (pipe, 1, 1) != EWOULDBLOCK) - ready |= SELECT_READ; /* Data immediately readable (or error). */ - mutex_unlock (&pipe->lock); - } - else - ready |= SELECT_READ; /* Error immediately available... */ + { + if (cred->po->openmodes & O_READ) + { + mutex_lock (&pipe->lock); + if (pipe_wait_readable (pipe, 1, 1) != EWOULDBLOCK) + ready |= SELECT_READ; /* Data immediately readable (or error). */ + mutex_unlock (&pipe->lock); + } + else + ready |= SELECT_READ; /* Error immediately available... */ + } if (*select_type & SELECT_WRITE) - if (cred->po->openmodes & O_WRITE) - { - mutex_lock (&pipe->lock); - if (pipe_wait_writable (pipe, 1) != EWOULDBLOCK) - ready |= SELECT_WRITE; /* Data immediately writable (or error). */ - mutex_unlock (&pipe->lock); - } - else - ready |= SELECT_WRITE; /* Error immediately available... */ + { + if (cred->po->openmodes & O_WRITE) + { + mutex_lock (&pipe->lock); + if (pipe_wait_writable (pipe, 1) != EWOULDBLOCK) + ready |= SELECT_WRITE; /* Data immediately writable (or error). */ + mutex_unlock (&pipe->lock); + } + else + ready |= SELECT_WRITE; /* Error immediately available... */ + } if (ready) *select_type = ready; -- cgit v1.2.3