summaryrefslogtreecommitdiff
path: root/libpipe/pipe.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-09-11 02:08:51 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-09-11 02:09:37 +0200
commit25ddda6354c4b70bcd8abb79770764d8ee3d6fc3 (patch)
tree7bb5a4fd53e4f4753b4bd59f4d34cd2af1d8e53e /libpipe/pipe.c
parentdf2b1fb2caed423b22f6d59d22f087100dd1b7d8 (diff)
Fix detection of terminated dgram pflocal server
* libpipe/pipe.c (_pipe_no_readers): Break pipe for connection-less pipes too.
Diffstat (limited to 'libpipe/pipe.c')
-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);
}