diff options
-rw-r--r-- | nuttx/libc/signal/sig_addset.c | 35 | ||||
-rw-r--r-- | nuttx/libc/signal/sig_delset.c | 36 | ||||
-rw-r--r-- | nuttx/libc/signal/sig_emptyset.c | 23 |
3 files changed, 19 insertions, 75 deletions
diff --git a/nuttx/libc/signal/sig_addset.c b/nuttx/libc/signal/sig_addset.c index 3a9da104c..1379d3ceb 100644 --- a/nuttx/libc/signal/sig_addset.c +++ b/nuttx/libc/signal/sig_addset.c @@ -38,26 +38,7 @@ ****************************************************************************/ #include <signal.h> - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Global Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ +#include <errno.h> /**************************************************************************** * Public Functions @@ -83,18 +64,18 @@ int sigaddset(FAR sigset_t *set, int signo) { - int ret = ERROR; - /* Verify the signal */ - if (GOOD_SIGNO(signo)) + if (!GOOD_SIGNO(signo)) + { + set_errno(EINVAL); + return ERROR; + } + else { /* Add the signal to the set */ *set |= SIGNO2SET(signo); - ret = OK; + return OK; } - - return ret; } - diff --git a/nuttx/libc/signal/sig_delset.c b/nuttx/libc/signal/sig_delset.c index 58e17ec1e..9c488e701 100644 --- a/nuttx/libc/signal/sig_delset.c +++ b/nuttx/libc/signal/sig_delset.c @@ -38,26 +38,7 @@ ****************************************************************************/ #include <signal.h> - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Global Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ +#include <errno.h> /**************************************************************************** * Public Functions @@ -83,18 +64,19 @@ int sigdelset(FAR sigset_t *set, int signo) { - int ret = ERROR; - /* Verify the signal */ - if (GOOD_SIGNO(signo)) + if (!GOOD_SIGNO(signo)) + { + set_errno(EINVAL); + return ERROR; + } + else { - /* Delete the signal to the set */ + /* Remove the signal from the set */ *set &= ~SIGNO2SET(signo); - ret = OK; + return OK; } - - return ret; } diff --git a/nuttx/libc/signal/sig_emptyset.c b/nuttx/libc/signal/sig_emptyset.c index 4163fe156..c41ae65a4 100644 --- a/nuttx/libc/signal/sig_emptyset.c +++ b/nuttx/libc/signal/sig_emptyset.c @@ -38,26 +38,7 @@ ****************************************************************************/ #include <signal.h> - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Global Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ +#include <errno.h> /**************************************************************************** * Public Functions @@ -71,7 +52,7 @@ * signals are excluded. * * Parameters: - * set - Signal set to initalize + * set - Signal set to initialize * * Return Value: * 0 (OK), or -1 (ERROR) if the signal set cannot be initialized. |