summaryrefslogtreecommitdiff
path: root/libpipe
diff options
context:
space:
mode:
Diffstat (limited to 'libpipe')
-rw-r--r--libpipe/pipe.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/libpipe/pipe.c b/libpipe/pipe.c
index 9580eb77..c3d2a28b 100644
--- a/libpipe/pipe.c
+++ b/libpipe/pipe.c
@@ -164,16 +164,15 @@ void _pipe_no_readers (struct pipe *pipe)
pipe_free (pipe);
else
{
- if (! pipe_is_connless (pipe))
+ /* When there is no reader, we have to break pipe even for
+ connection-less pipes. */
+ pipe->flags |= PIPE_BROKEN;
+ if (pipe->writers)
+ /* Wake up writers for the bad news... */
{
- pipe->flags |= PIPE_BROKEN;
- if (pipe->writers)
- /* Wake up writers for the bad news... */
- {
- pthread_cond_broadcast (&pipe->pending_writes);
- pthread_cond_broadcast (&pipe->pending_write_selects);
- pipe_select_cond_broadcast (pipe);
- }
+ pthread_cond_broadcast (&pipe->pending_writes);
+ pthread_cond_broadcast (&pipe->pending_write_selects);
+ pipe_select_cond_broadcast (pipe);
}
pthread_mutex_unlock (&pipe->lock);
}