summaryrefslogtreecommitdiff
path: root/nuttx/sched/sig_procmask.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-02-27 21:17:21 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-02-27 21:17:21 +0000
commit148cde5e982950ad5836fa96baa466de842e1c14 (patch)
treebf737b367b91c5da81345eb21016b07400d7a72f /nuttx/sched/sig_procmask.c
parentf6b81a790c28d7d36d9de33810df5270c1ebbfd7 (diff)
downloadpx4-nuttx-148cde5e982950ad5836fa96baa466de842e1c14.tar.gz
px4-nuttx-148cde5e982950ad5836fa96baa466de842e1c14.tar.bz2
px4-nuttx-148cde5e982950ad5836fa96baa466de842e1c14.zip
Finally, a clean SDCC compile
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@20 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/sig_procmask.c')
-rw-r--r--nuttx/sched/sig_procmask.c63
1 files changed, 36 insertions, 27 deletions
diff --git a/nuttx/sched/sig_procmask.c b/nuttx/sched/sig_procmask.c
index dd5dd9eb8..339e6dda5 100644
--- a/nuttx/sched/sig_procmask.c
+++ b/nuttx/sched/sig_procmask.c
@@ -114,7 +114,7 @@
int sigprocmask(int how, const sigset_t *set, sigset_t *oset)
{
- _TCB *rtcb = (_TCB*)g_readytorun.head;
+ FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
sigset_t oldsigprocmask;
irqstate_t saved_state;
int ret = OK;
@@ -124,48 +124,57 @@ int sigprocmask(int how, const sigset_t *set, sigset_t *oset)
/* Return the old signal mask if requested */
oldsigprocmask = rtcb->sigprocmask;
- if (oset) *oset = oldsigprocmask;
+ if (oset)
+ {
+ *oset = oldsigprocmask;
+ }
/* Modify the current signal mask if so requested */
- if (set) {
- /* Some of these operations are non-atomic. We need to protect
- * ourselves from attempts to process signals from interrupts */
- saved_state = irqsave();
+ if (set)
+ {
+ /* Some of these operations are non-atomic. We need to protect
+ * ourselves from attempts to process signals from interrupts
+ */
- /* Okay, determine what we are supposed to do */
+ saved_state = irqsave();
- switch (how) {
- /* The resulting set is the union of the current set and the
- * signal set pointed to by set. */
+ /* Okay, determine what we are supposed to do */
- case SIG_BLOCK:
- rtcb->sigprocmask |= *set;
- break;
+ switch (how)
+ {
+ /* The resulting set is the union of the current set and the
+ * signal set pointed to by set.
+ */
- /* The resulting set is the intersection of the current set and
- * the complement of the signal set pointed to by _set. */
+ case SIG_BLOCK:
+ rtcb->sigprocmask |= *set;
+ break;
- case SIG_UNBLOCK:
- rtcb->sigprocmask &= ~(*set);
- break;
+ /* The resulting set is the intersection of the current set and
+ * the complement of the signal set pointed to by _set.
+ */
- /* The resulting set is the signal set pointed to by set. */
+ case SIG_UNBLOCK:
+ rtcb->sigprocmask &= ~(*set);
+ break;
- case SIG_SETMASK:
- rtcb->sigprocmask = *set;
- break;
+ /* The resulting set is the signal set pointed to by set. */
- default:
- ret = ERROR;
- break;
- } /* end switch */
+ case SIG_SETMASK:
+ rtcb->sigprocmask = *set;
+ break;
+
+ default:
+ ret = ERROR;
+ break;
+ }
irqrestore(saved_state);
/* Now, process any pending signals that were just unmasked */
sig_unmaskpendingsignal();
- } /* end if */
+ }
sched_unlock();
return ret;