diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-05-17 16:55:13 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-05-17 16:55:13 +0000 |
commit | 19e5ee4c8113774aef8735894431f5f86348630c (patch) | |
tree | 99bfbd591a8a3aa0175b6ea074293e7faaff1a05 /nuttx/sched | |
parent | b231fb795e6e08765afd0b4336eb041039ce5c05 (diff) | |
download | px4-firmware-19e5ee4c8113774aef8735894431f5f86348630c.tar.gz px4-firmware-19e5ee4c8113774aef8735894431f5f86348630c.tar.bz2 px4-firmware-19e5ee4c8113774aef8735894431f5f86348630c.zip |
Fix a C++ link issue: If constant strings used only in constructor, the don't get linked into the final executable
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4743 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/mq_rcvinternal.c | 22 | ||||
-rw-r--r-- | nuttx/sched/mq_send.c | 5 | ||||
-rw-r--r-- | nuttx/sched/mq_sndinternal.c | 4 |
3 files changed, 20 insertions, 11 deletions
diff --git a/nuttx/sched/mq_rcvinternal.c b/nuttx/sched/mq_rcvinternal.c index 744094322..8ec066da8 100644 --- a/nuttx/sched/mq_rcvinternal.c +++ b/nuttx/sched/mq_rcvinternal.c @@ -1,8 +1,8 @@ /**************************************************************************** * sched/mq_rcvinternal.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,15 +37,19 @@ * Included Files ****************************************************************************/ +#include <nuttx/config.h> + #include <sys/types.h> -#include <fcntl.h> /* O_NONBLOCK */ +#include <fcntl.h> #include <string.h> #include <assert.h> #include <errno.h> #include <mqueue.h> #include <sched.h> #include <debug.h> + #include <nuttx/arch.h> + #include "os_internal.h" #include "mq_internal.h" @@ -105,19 +109,19 @@ int mq_verifyreceive(mqd_t mqdes, void *msg, size_t msglen) if (!msg || !mqdes) { - *get_errno_ptr() = EINVAL; + set_errno(EINVAL); return ERROR; } if ((mqdes->oflags & O_RDOK) == 0) { - *get_errno_ptr() = EPERM; + set_errno(EPERM); return ERROR; } if (msglen < (size_t)mqdes->msgq->maxmsgsize) { - *get_errno_ptr() = EMSGSIZE; + set_errno(EMSGSIZE); return ERROR; } @@ -178,7 +182,7 @@ FAR mqmsg_t *mq_waitreceive(mqd_t mqdes) rtcb->msgwaitq = msgq; msgq->nwaitnotempty++; - *get_errno_ptr() = OK; + set_errno(OK); up_block_task(rtcb, TSTATE_WAIT_MQNOTEMPTY); /* When we resume at this point, either (1) the message queue @@ -187,7 +191,7 @@ FAR mqmsg_t *mq_waitreceive(mqd_t mqdes) * errno value (should be either EINTR or ETIMEDOUT). */ - if (*get_errno_ptr() != OK) + if (get_errno() != OK) { break; } @@ -198,7 +202,7 @@ FAR mqmsg_t *mq_waitreceive(mqd_t mqdes) * message queue description referred to by 'mqdes'. */ - *get_errno_ptr() = EAGAIN; + set_errno(EAGAIN); break; } } diff --git a/nuttx/sched/mq_send.c b/nuttx/sched/mq_send.c index 3a2284033..921ff7fcc 100644 --- a/nuttx/sched/mq_send.c +++ b/nuttx/sched/mq_send.c @@ -2,7 +2,7 @@ * sched/mq_send.c * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,11 +38,14 @@ ****************************************************************************/ #include <nuttx/config.h> + #include <sys/types.h> #include <mqueue.h> #include <errno.h> #include <debug.h> + #include <nuttx/arch.h> + #include "os_internal.h" #include "mq_internal.h" diff --git a/nuttx/sched/mq_sndinternal.c b/nuttx/sched/mq_sndinternal.c index b359f6f17..3d9c88769 100644 --- a/nuttx/sched/mq_sndinternal.c +++ b/nuttx/sched/mq_sndinternal.c @@ -2,7 +2,7 @@ * sched/mq_send.c * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -417,6 +417,7 @@ int mq_dosend(mqd_t mqdes, FAR mqmsg_t *mqmsg, const void *msg, size_t msglen, i #endif } #endif + /* Check if any tasks are waiting for the MQ not empty event. */ saved_state = irqsave(); @@ -445,6 +446,7 @@ int mq_dosend(mqd_t mqdes, FAR mqmsg_t *mqmsg, const void *msg, size_t msglen, i up_unblock_task(btcb); } } + irqrestore(saved_state); sched_unlock(); return OK; |