diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-09-11 02:08:51 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-09-11 02:09:37 +0200 |
commit | 25ddda6354c4b70bcd8abb79770764d8ee3d6fc3 (patch) | |
tree | 7bb5a4fd53e4f4753b4bd59f4d34cd2af1d8e53e /libpipe/pipe.c | |
parent | df2b1fb2caed423b22f6d59d22f087100dd1b7d8 (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.c | 17 |
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); } |