nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-nuttx] patacongo commented on a change in pull request #911: Use NuttX's signal set functions inside the OS.
Date Wed, 29 Apr 2020 18:48:26 GMT

patacongo commented on a change in pull request #911:
URL: https://github.com/apache/incubator-nuttx/pull/911#discussion_r417521036



##########
File path: libs/libc/signal/sig_addset.c
##########
@@ -79,3 +78,37 @@ int sigaddset(FAR sigset_t *set, int signo)
       return OK;
     }
 }
+
+/****************************************************************************
+ * Name: sigaddset
+ *
+ * Description:
+ *   This function adds the signal specified by signo to the signal set
+ *   specified by set.
+ *
+ * Input Parameters:
+ *   set - Signal set to add signal to
+ *   signo - Signal to add
+ *
+ * Returned Value:
+ *   0 (OK), or -1 (ERROR) if the signal number is invalid.
+ *
+ * Assumptions:
+ *
+ ****************************************************************************/
+
+int sigaddset(FAR sigset_t *set, int signo)
+{
+  int ret;
+
+  /* Let nxsig_addset do all the work. */
+
+  ret = nxsig_addset(set, signo);
+  if (ret < 0)
+    {
+      set_errno(EINVAL);

Review comment:
       In the general case, it should set_errno(-ret);  In this case, -EINVAL should be the
only value returned by nxsig_addset() so it does not matter.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message