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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Nov  1 19:23:33 2009 +0100

native: pass errno back as returned by kernel

---

 src/skins/native/heap.c  |    3 +--
 src/skins/native/queue.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/skins/native/heap.c b/src/skins/native/heap.c
index a29a8d8..0dfd8be 100644
--- a/src/skins/native/heap.c
+++ b/src/skins/native/heap.c
@@ -50,12 +50,11 @@ static int __map_heap_memory(RT_HEAP *heap, 
RT_HEAP_PLACEHOLDER * php)
                                             php->mapsize,
                                             PROT_READ | PROT_WRITE,
                                             MAP_SHARED, heapfd, 0L);
-
        if (php->mapbase != MAP_FAILED)
                /* Copy back a complete placeholder only if all is ok. */
                *heap = *php;
        else
-               err = -ENOMEM;
+               err = -errno;
 
       close_and_exit:
 
diff --git a/src/skins/native/queue.c b/src/skins/native/queue.c
index 829fca1..277dd68 100644
--- a/src/skins/native/queue.c
+++ b/src/skins/native/queue.c
@@ -50,12 +50,11 @@ static int __map_queue_memory(RT_QUEUE *q, 
RT_QUEUE_PLACEHOLDER * php)
                                             php->mapsize,
                                             PROT_READ | PROT_WRITE,
                                             MAP_SHARED, heapfd, 0L);
-
        if (php->mapbase != MAP_FAILED)
                /* Copy back a complete placeholder only if all is ok. */
                *q = *php;
        else
-               err = -ENOMEM;
+               err = -errno;
 
       close_and_exit:
 


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

Reply via email to