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

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Wed Dec 25 16:49:14 2013 +0100

addendum fd: fd not found is EBADF, not ENOENT

---

 kernel/cobalt/fd.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/kernel/cobalt/fd.c b/kernel/cobalt/fd.c
index 4803af5..19d4569 100644
--- a/kernel/cobalt/fd.c
+++ b/kernel/cobalt/fd.c
@@ -86,12 +86,7 @@ struct xnfd *xnfd_get(int ufd, struct mm_struct *mm, 
unsigned magic)
        
        xnlock_get_irqsave(&xnfd_lock, s);
        res = xnfd_hash_search(ufd, mm);
-       if (res == NULL) {
-               res = ERR_PTR(-ENOENT);
-               goto err_unlock;
-       }
-       
-       if (res->magic != magic) {
+       if (res == NULL || res->magic != magic) {
                res = ERR_PTR(-EBADF);
                goto err_unlock;
        }


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

Reply via email to