summaryrefslogtreecommitdiff
path: root/libpipe/pipe.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2016-06-01 23:19:19 +0200
committerRichard Braun <rbraun@sceen.net>2016-06-01 23:22:25 +0200
commit293e86998748bae2d7a8179ad198ec3452f0d472 (patch)
treed524a09bdb1b49951dcac059ab699acfc6619a1e /libpipe/pipe.c
parent1a36fdfe7cf17aa23f0bd43eb6cca4d28e510def (diff)
Fix pipe_send() with no data
* libpipe/pipe.c (pipe_send): Set value pointed to by amount to 0 if if nothing is written.
Diffstat (limited to 'libpipe/pipe.c')
-rw-r--r--libpipe/pipe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libpipe/pipe.c b/libpipe/pipe.c
index c3d2a28b..0b539218 100644
--- a/libpipe/pipe.c
+++ b/libpipe/pipe.c
@@ -319,7 +319,10 @@ pipe_send (struct pipe *pipe, int noblock, void *source,
/* Nothing to do. */
if (data_len == 0 && control_len == 0 && num_ports == 0)
- return 0;
+ {
+ *amount = 0;
+ return 0;
+ }
err = pipe_wait_writable (pipe, noblock);
if (err)