Module: xenomai-gch
Branch: for-forge
Commit: 608e53b2113527a7763786f963060cd5a46081a1
URL:    
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=608e53b2113527a7763786f963060cd5a46081a1

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Thu Oct 30 22:00:34 2014 +0100

cobalt/timerfd: use O_NONBLOCK from fd flags, instead of local flags

this makes changing the O_NONBLOCK flag possible with fcntl

---

 kernel/cobalt/posix/timerfd.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/cobalt/posix/timerfd.c b/kernel/cobalt/posix/timerfd.c
index 7324ce9..93cbf01 100644
--- a/kernel/cobalt/posix/timerfd.c
+++ b/kernel/cobalt/posix/timerfd.c
@@ -66,7 +66,7 @@ static ssize_t timerfd_read(struct rtdm_fd *fd, void __user 
*buf, size_t size)
                err = 0;
                goto out;
        }
-       if (tfd->flags & TFD_NONBLOCK) {
+       if (rtdm_fd_flags(fd) & O_NONBLOCK) {
                err = -EAGAIN;
                goto out;
        }
@@ -188,7 +188,8 @@ COBALT_SYSCALL(timerfd_create, lostage,
                goto fail_getfd;
        }
 
-       tfd->flags = flags;
+       tfd->flags = flags & ~TFD_NONBLOCK;
+       tfd->fd.oflags = (flags & TFD_NONBLOCK) ? O_NONBLOCK : 0;
        tfd->clockid = clockid;
        curr = xnthread_current();
        xntimer_init(&tfd->timer, &nkclock, timerfd_handler,


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to