mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-07-05 11:20:00 +08:00
Change the name of the local variable sigset to set to prevent name collisions with the function of the same name
This commit is contained in:
parent
d699f5766d
commit
09add96e22
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examplex/ajoystick/ajoy_main.c
|
* examplex/ajoystick/ajoy_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -196,16 +196,16 @@ static void show_joystick(FAR const struct ajoy_sample_s *sample)
|
|||||||
|
|
||||||
static int ajoy_wait(int fd, FAR const struct timespec *timeout)
|
static int ajoy_wait(int fd, FAR const struct timespec *timeout)
|
||||||
{
|
{
|
||||||
sigset_t sigset;
|
sigset_t set;
|
||||||
struct siginfo value;
|
struct siginfo value;
|
||||||
ajoy_buttonset_t newset;
|
ajoy_buttonset_t newset;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Wait for a signal */
|
/* Wait for a signal */
|
||||||
|
|
||||||
(void)sigemptyset(&sigset);
|
(void)sigemptyset(&set);
|
||||||
(void)sigaddset(&sigset, CONFIG_EXAMPLES_AJOYSTICK_SIGNO);
|
(void)sigaddset(&set, CONFIG_EXAMPLES_AJOYSTICK_SIGNO);
|
||||||
ret = sigtimedwait(&sigset, &value, timeout);
|
ret = sigtimedwait(&set, &value, timeout);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
int errcode = errno;
|
int errcode = errno;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examplex/djoystick/djoy_main.c
|
* examplex/djoystick/djoy_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -204,15 +204,15 @@ int djoy_main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
struct siginfo value;
|
struct siginfo value;
|
||||||
sigset_t sigset;
|
sigset_t set;
|
||||||
djoy_buttonset_t newset;
|
djoy_buttonset_t newset;
|
||||||
ssize_t nread;
|
ssize_t nread;
|
||||||
|
|
||||||
/* Wait for a signal */
|
/* Wait for a signal */
|
||||||
|
|
||||||
(void)sigemptyset(&sigset);
|
(void)sigemptyset(&set);
|
||||||
(void)sigaddset(&sigset, CONFIG_EXAMPLES_DJOYSTICK_SIGNO);
|
(void)sigaddset(&set, CONFIG_EXAMPLES_DJOYSTICK_SIGNO);
|
||||||
ret = sigwaitinfo(&sigset, &value);
|
ret = sigwaitinfo(&set, &value);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "ERROR: sigwaitinfo() failed: %d\n", errno);
|
fprintf(stderr, "ERROR: sigwaitinfo() failed: %d\n", errno);
|
||||||
|
@ -140,7 +140,7 @@ static void timer_expiration(int signo, siginfo_t *info, void *ucontext)
|
|||||||
|
|
||||||
void timer_test(void)
|
void timer_test(void)
|
||||||
{
|
{
|
||||||
sigset_t sigset;
|
sigset_t set;
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
struct sigaction oact;
|
struct sigaction oact;
|
||||||
struct sigevent notify;
|
struct sigevent notify;
|
||||||
@ -156,9 +156,9 @@ void timer_test(void)
|
|||||||
|
|
||||||
printf("timer_test: Unmasking signal %d\n" , MY_TIMER_SIGNAL);
|
printf("timer_test: Unmasking signal %d\n" , MY_TIMER_SIGNAL);
|
||||||
|
|
||||||
(void)sigemptyset(&sigset);
|
(void)sigemptyset(&set);
|
||||||
(void)sigaddset(&sigset, MY_TIMER_SIGNAL);
|
(void)sigaddset(&set, MY_TIMER_SIGNAL);
|
||||||
status = sigprocmask(SIG_UNBLOCK, &sigset, NULL);
|
status = sigprocmask(SIG_UNBLOCK, &set, NULL);
|
||||||
if (status != OK)
|
if (status != OK)
|
||||||
{
|
{
|
||||||
printf("timer_test: ERROR sigprocmask failed, status=%d\n",
|
printf("timer_test: ERROR sigprocmask failed, status=%d\n",
|
||||||
|
@ -151,7 +151,7 @@ static void wakeup_action(int signo, siginfo_t *info, void *ucontext)
|
|||||||
|
|
||||||
static int waiter_main(int argc, char *argv[])
|
static int waiter_main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
sigset_t sigset;
|
sigset_t set;
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
struct sigaction oact;
|
struct sigaction oact;
|
||||||
int status;
|
int status;
|
||||||
@ -159,9 +159,9 @@ static int waiter_main(int argc, char *argv[])
|
|||||||
printf("waiter_main: Waiter started\n" );
|
printf("waiter_main: Waiter started\n" );
|
||||||
|
|
||||||
printf("waiter_main: Unmasking signal %d\n" , WAKEUP_SIGNAL);
|
printf("waiter_main: Unmasking signal %d\n" , WAKEUP_SIGNAL);
|
||||||
(void)sigemptyset(&sigset);
|
(void)sigemptyset(&set);
|
||||||
(void)sigaddset(&sigset, WAKEUP_SIGNAL);
|
(void)sigaddset(&set, WAKEUP_SIGNAL);
|
||||||
status = sigprocmask(SIG_UNBLOCK, &sigset, NULL);
|
status = sigprocmask(SIG_UNBLOCK, &set, NULL);
|
||||||
if (status != OK)
|
if (status != OK)
|
||||||
{
|
{
|
||||||
printf("waiter_main: ERROR sigprocmask failed, status=%d\n",
|
printf("waiter_main: ERROR sigprocmask failed, status=%d\n",
|
||||||
@ -230,7 +230,7 @@ void sighand_test(void)
|
|||||||
#ifdef CONFIG_SCHED_HAVE_PARENT
|
#ifdef CONFIG_SCHED_HAVE_PARENT
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
struct sigaction oact;
|
struct sigaction oact;
|
||||||
sigset_t sigset;
|
sigset_t set;
|
||||||
#endif
|
#endif
|
||||||
struct sched_param param;
|
struct sched_param param;
|
||||||
union sigval sigvalue;
|
union sigval sigvalue;
|
||||||
@ -243,9 +243,9 @@ void sighand_test(void)
|
|||||||
#ifdef CONFIG_SCHED_HAVE_PARENT
|
#ifdef CONFIG_SCHED_HAVE_PARENT
|
||||||
printf("sighand_test: Unmasking SIGCHLD\n");
|
printf("sighand_test: Unmasking SIGCHLD\n");
|
||||||
|
|
||||||
(void)sigemptyset(&sigset);
|
(void)sigemptyset(&set);
|
||||||
(void)sigaddset(&sigset, SIGCHLD);
|
(void)sigaddset(&set, SIGCHLD);
|
||||||
status = sigprocmask(SIG_UNBLOCK, &sigset, NULL);
|
status = sigprocmask(SIG_UNBLOCK, &set, NULL);
|
||||||
if (status != OK)
|
if (status != OK)
|
||||||
{
|
{
|
||||||
printf("sighand_test: ERROR sigprocmask failed, status=%d\n",
|
printf("sighand_test: ERROR sigprocmask failed, status=%d\n",
|
||||||
|
@ -107,7 +107,7 @@ static void waiter_action(int signo)
|
|||||||
|
|
||||||
static int waiter_main(int argc, char *argv[])
|
static int waiter_main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
sigset_t sigset;
|
sigset_t set;
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i;
|
||||||
@ -115,8 +115,8 @@ static int waiter_main(int argc, char *argv[])
|
|||||||
printf("waiter_main: Waiter started\n" );
|
printf("waiter_main: Waiter started\n" );
|
||||||
printf("waiter_main: Setting signal mask\n" );
|
printf("waiter_main: Setting signal mask\n" );
|
||||||
|
|
||||||
(void)sigemptyset(&sigset);
|
(void)sigemptyset(&set);
|
||||||
ret = sigprocmask(SIG_SETMASK, &sigset, NULL);
|
ret = sigprocmask(SIG_SETMASK, &set, NULL);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
printf("waiter_main: ERROR sigprocmask failed: %d\n", errno);
|
printf("waiter_main: ERROR sigprocmask failed: %d\n", errno);
|
||||||
|
@ -145,15 +145,15 @@ static struct trv_joystick_s g_trv_joystick;
|
|||||||
#ifdef CONFIG_GRAPHICS_TRAVELER_AJOYSTICK
|
#ifdef CONFIG_GRAPHICS_TRAVELER_AJOYSTICK
|
||||||
static int trv_joystick_wait(void)
|
static int trv_joystick_wait(void)
|
||||||
{
|
{
|
||||||
sigset_t sigset;
|
sigset_t set;
|
||||||
struct siginfo value;
|
struct siginfo value;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Wait for a signal */
|
/* Wait for a signal */
|
||||||
|
|
||||||
(void)sigemptyset(&sigset);
|
(void)sigemptyset(&set);
|
||||||
(void)sigaddset(&sigset, CONFIG_GRAPHICS_TRAVELER_JOYSTICK_SIGNO);
|
(void)sigaddset(&set, CONFIG_GRAPHICS_TRAVELER_JOYSTICK_SIGNO);
|
||||||
ret = sigwaitinfo(&sigset, &value);
|
ret = sigwaitinfo(&set, &value);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
int errcode = errno;
|
int errcode = errno;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user