summaryrefslogtreecommitdiff
path: root/libpipe
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-01-14 04:48:11 +0000
committerMiles Bader <miles@gnu.org>1996-01-14 04:48:11 +0000
commitca7688018fd7e5806f009b4f7b1c05afcc3271c8 (patch)
tree23a6bb43287f06e44e8b2925307763186bfc501a /libpipe
parent25e8145300ec1ad38f82fce22258955e5fedafd4 (diff)
(pipe_send):
For non-blocking writes, avoid writing more than the user requested.
Diffstat (limited to 'libpipe')
-rw-r--r--libpipe/pipe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpipe/pipe.c b/libpipe/pipe.c
index 4e52ac04..7f36e5f8 100644
--- a/libpipe/pipe.c
+++ b/libpipe/pipe.c
@@ -259,7 +259,7 @@ pipe_send (struct pipe *pipe, int noblock, void *source,
if (noblock)
{
size_t left = pipe->write_limit - pipe_readable (pipe, 1);
- if (left > data_len)
+ if (left < data_len)
if (data_len <= pipe->write_atomic)
return EWOULDBLOCK;
else