summaryrefslogtreecommitdiff
path: root/libpipe/pipe.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2014-06-30 21:28:19 +0200
committerRichard Braun <rbraun@sceen.net>2014-06-30 21:31:15 +0200
commit2588cd19e83ff454a7fc99e68f1d612945504b72 (patch)
treea3fd7b45edff59e20f758ed37f436214faccc095 /libpipe/pipe.c
parent6ad2a33e7fc5cda05eefdec789f4a2033645ebbe (diff)
libpipe: fix spurious calls to pipe_send
* libpipe/pipe.c (pipe_send): Skip processing if there is nothing to send.
Diffstat (limited to 'libpipe/pipe.c')
-rw-r--r--libpipe/pipe.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libpipe/pipe.c b/libpipe/pipe.c
index f9300e7c..b7ee8515 100644
--- a/libpipe/pipe.c
+++ b/libpipe/pipe.c
@@ -316,7 +316,11 @@ pipe_send (struct pipe *pipe, int noblock, void *source,
mach_port_t *ports, size_t num_ports,
size_t *amount)
{
- error_t err = 0;
+ error_t err;
+
+ /* Nothing to do. */
+ if (data_len == 0 && control_len == 0 && num_ports == 0)
+ return 0;
err = pipe_wait_writable (pipe, noblock);
if (err)