summaryrefslogtreecommitdiff
path: root/nuttx/libc/signal/sig_addset.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/libc/signal/sig_addset.c')
-rw-r--r--nuttx/libc/signal/sig_addset.c35
1 files changed, 8 insertions, 27 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;
}
-