acassis commented on a change in pull request #742:
URL: 
https://github.com/apache/incubator-nuttx-apps/pull/742#discussion_r643054835



##########
File path: nshlib/nsh_proccmds.c
##########
@@ -613,29 +614,54 @@ int cmd_ps(FAR struct nsh_vtbl_s *vtbl, int argc, char 
**argv)
 #ifndef CONFIG_NSH_DISABLE_KILL
 int cmd_kill(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
 {
+/* kill will send SIGTERM to the task in case no signal is selected by

Review comment:
       You need to space in the line bellow "{" to align correctly

##########
File path: nshlib/nsh_proccmds.c
##########
@@ -613,29 +614,54 @@ int cmd_ps(FAR struct nsh_vtbl_s *vtbl, int argc, char 
**argv)
 #ifndef CONFIG_NSH_DISABLE_KILL
 int cmd_kill(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
 {
+/* kill will send SIGTERM to the task in case no signal is selected by
+ * -<signal> option
+ */
+
   char *ptr;
   char *endptr;
   long signal;
   long pid;
 
-  /* Check incoming parameters.  The first parameter should be "-<signal>" */
-
-  ptr = argv[1];
-  if (*ptr != '-' || ptr[1] < '0' || ptr[1] > '9')
+  if (argc == 3)  /* kill -<signal> <pid> */
     {
-      goto invalid_arg;
-    }
+      /* Check incoming parameters.
+       * The first parameter should be "-<signal>"
+       */
 
-  /* Extract the signal number */
+      ptr = argv[1];
+      if (*ptr != '-' || ptr[1] < '0' || ptr[1] > '9')

Review comment:
       In the future to be more compatible with Unix and Linux, it should also 
accept the signal name, ie:
   $ kill -SIGTERM 4297




-- 
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:
[email protected]


Reply via email to