Module: xenomai-2.6
Branch: master
Commit: d7ef5ebfa349b57e3537929c2ba0020bb107803e
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=d7ef5ebfa349b57e3537929c2ba0020bb107803e

Author: Wolfgang Grandegger <w...@denx.de>
Date:   Mon Mar 26 09:21:51 2012 +0200

nucleus: fix poll EOF issue with xnpipe/rt_pipe

So far, the EOF event is not handled in the Linux poll function of the
xnpipe/rt_pipe service when the pipe is closed (via rt_pipde_delete).
This patch fixes the issue by setting POLLUP in the Linux poll function
when the pipe is broken. The subsequent reads will then fail with errno
EPIPE.

Signed-off-by: Wolfgang Grandegger <w...@denx.de>

---

 ksrc/nucleus/pipe.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/ksrc/nucleus/pipe.c b/ksrc/nucleus/pipe.c
index 1e6bcf2..1d5e39a 100644
--- a/ksrc/nucleus/pipe.c
+++ b/ksrc/nucleus/pipe.c
@@ -1033,6 +1033,8 @@ static unsigned xnpipe_poll(struct file *file, poll_table 
*pt)
 
        if (testbits(state->status, XNPIPE_KERN_CONN))
                w_mask |= (POLLOUT | POLLWRNORM);
+       else
+               r_mask |= POLLHUP;
 
        if (!emptyq_p(&state->outq))
                r_mask |= (POLLIN | POLLRDNORM);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to