mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Squashed commit of the following:
Replace all calls to sigqueue() in the OS proper with calls to nxsig_queue() to avoid accessing the errno variable.
sched/signal: Add nxsig_queue() which is functionally equivalent to sigqueue() except that it does not modify the errno variable.
This commit is contained in:
@@ -58,9 +58,10 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/signal.h>
|
||||
#include <nuttx/random.h>
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/input/ajoystick.h>
|
||||
#include <nuttx/random.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
@@ -376,10 +377,12 @@ static void ajoy_sample(FAR struct ajoy_upperhalf_s *priv)
|
||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||
union sigval value;
|
||||
value.sival_int = (int)sample;
|
||||
(void)sigqueue(opriv->ao_pid, opriv->ao_notify.an_signo, value);
|
||||
|
||||
(void)nxsig_queue(opriv->ao_pid, opriv->ao_notify.an_signo,
|
||||
value);
|
||||
#else
|
||||
(void)sigqueue(opriv->ao_pid, opriv->ao_notify.dn.signo,
|
||||
(FAR void *)sample);
|
||||
(void)nxsig_queue(opriv->ao_pid, opriv->ao_notify.dn.signo,
|
||||
(FAR void *)sample);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -54,9 +54,10 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/signal.h>
|
||||
#include <nuttx/random.h>
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/input/buttons.h>
|
||||
#include <nuttx/random.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
@@ -358,10 +359,11 @@ static void btn_sample(FAR struct btn_upperhalf_s *priv)
|
||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||
union sigval value;
|
||||
value.sival_int = (int)sample;
|
||||
(void)sigqueue(opriv->bo_pid, opriv->bo_notify.bn_signo, value);
|
||||
(void)nxsig_queue(opriv->bo_pid, opriv->bo_notify.bn_signo,
|
||||
value);
|
||||
#else
|
||||
(void)sigqueue(opriv->bo_pid, opriv->bo_notify.dn.signo,
|
||||
(FAR void *)sample);
|
||||
(void)nxsig_queue(opriv->bo_pid, opriv->bo_notify.dn.signo,
|
||||
(FAR void *)sample);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -58,9 +58,10 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/signal.h>
|
||||
#include <nuttx/random.h>
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/input/djoystick.h>
|
||||
#include <nuttx/random.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
@@ -376,10 +377,11 @@ static void djoy_sample(FAR struct djoy_upperhalf_s *priv)
|
||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||
union sigval value;
|
||||
value.sival_int = (int)sample;
|
||||
(void)sigqueue(opriv->do_pid, opriv->do_notify.dn_signo, value);
|
||||
(void)nxsig_queue(opriv->do_pid, opriv->do_notify.dn_signo,
|
||||
value);
|
||||
#else
|
||||
(void)sigqueue(opriv->do_pid, opriv->do_notify.dn.signo,
|
||||
(FAR void *)sample);
|
||||
(void)nxsig_queue(opriv->do_pid, opriv->do_notify.dn.signo,
|
||||
(FAR void *)sample);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user