Module: xenomai-forge
Branch: next
Commit: 20686366e23ccc954eb40d6c6b56f94995bcbd2b
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=20686366e23ccc954eb40d6c6b56f94995bcbd2b

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Sep 11 16:37:48 2014 +0200

lib/cobalt/sem: fix error status upon allocation failure

---

 lib/cobalt/semaphore.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/cobalt/semaphore.c b/lib/cobalt/semaphore.c
index f97b85e..87cea44 100644
--- a/lib/cobalt/semaphore.c
+++ b/lib/cobalt/semaphore.c
@@ -459,8 +459,9 @@ COBALT_IMPL(int, sem_getvalue, (sem_t *sem, int *sval))
  *   named semaphore already exists;
  * - ENOENT, the bit @a O_CREAT is not set in @a oflags and the named semaphore
  *   does not exist;
- * - ENOSPC, insufficient memory exists in the system heap to create the
- *   semaphore, increase CONFIG_XENO_OPT_SYS_HEAPSZ;
+ * - ENOMEM, not enough memory to create the semaphore. A usual
+ *   suspect is a shortage in the Cobalt system heap, which may be
+ *   fixed by increasing CONFIG_XENO_OPT_SYS_HEAPSZ;
  * - EINVAL, the @a value argument exceeds @a SEM_VALUE_MAX.
  *
  * @see
@@ -484,7 +485,7 @@ COBALT_IMPL(sem_t *, sem_open, (const char *name, int 
oflags, ...))
 
        rsem = sem = malloc(sizeof(*sem));
        if (rsem == NULL) {
-               err = -ENOSPC;
+               err = -ENOMEM;
                goto error;
        }
 


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

Reply via email to