Fixed coding std issues

This commit is contained in:
Subhra Sankha Sarkar
2020-10-29 14:47:32 +05:30
committed by Xiang Xiao
parent bd0ad68da8
commit 36b1be0609
5 changed files with 39 additions and 32 deletions

View File

@@ -108,8 +108,8 @@ int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
{
/* The application was successfully started with pre-emption disabled.
* In the simplest cases, the application will not have run because the
* the scheduler is locked. But in the case where I/O was redirected, a
* proxy task ran and broke our lock. As result, the application may
* the scheduler is locked. But in the case where I/O was redirected,
* a proxy task ran and broke our lock. As result, the application may
* have aso ran if its priority was higher than than the priority of
* this thread.
*
@@ -149,10 +149,10 @@ int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
* and if the application has not yet run, it will now be able to
* do so.
*
* Also, if CONFIG_SCHED_HAVE_PARENT is defined waitpid() might fail
* even if task is still active: If the I/O was re-directed by a
* proxy task, then the ask is a child of the proxy, and not this
* task. waitpid() fails with ECHILD in either case.
* Also, if CONFIG_SCHED_HAVE_PARENT is defined waitpid() might
* fail even if task is still active: If the I/O was re-directed
* by a proxy task, then the ask is a child of the proxy, and not
* this task. waitpid() fails with ECHILD in either case.
*
* NOTE: WUNTRACED does nothing in the default case, but in the
* case the where CONFIG_SIG_SIGSTOP_ACTION=y, the built-in app
@@ -164,12 +164,13 @@ int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
if (ret < 0)
{
/* If the child thread does not exist, waitpid() will return
* the error ECHLD. Since we know that the task was successfully
* started, this must be one of the cases described above; we
* have to assume that the task already exit'ed. In this case,
* we have no idea if the application ran successfully or not
* (because NuttX does not retain exit status of child tasks).
* Let's assume that is did run successfully.
* the error ECHLD. Since we know that the task was
* successfully started, this must be one of the cases
* described above; we have to assume that the task already
* exit'ed. In this case, we have no idea if the application
* ran successfully or not (because NuttX does not retain exit
* status of child tasks). Let's assume that is did run
* successfully.
*/
int errcode = errno;
@@ -189,16 +190,16 @@ int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
else
{
/* We can't return the exact status (nsh has nowhere to put it)
* so just pass back zero/nonzero in a fashion that doesn't look
* like an error.
* so just pass back zero/nonzero in a fashion that doesn't
* look like an error.
*/
ret = (rc == 0) ? OK : 1;
/* TODO: Set the environment variable '?' to a string corresponding
* to WEXITSTATUS(rc) so that $? will expand to the exit status of
* the most recently executed task.
*/
/* TODO: Set the environment variable '?' to a string
* corresponding to WEXITSTATUS(rc) so that $? will expand to
* the exit status of the most recently executed task.
*/
}
ioctl(stdout->fs_fd, TIOCSCTTY, -1);
@@ -212,13 +213,13 @@ int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
*
* - CONFIG_SCHED_WAITPID is not selected meaning that all commands
* have to be run in background, or
* - CONFIG_SCHED_WAITPID and CONFIG_NSH_DISABLEBG are both selected, but the
* user requested to run the command in background.
* - CONFIG_SCHED_WAITPID and CONFIG_NSH_DISABLEBG are both selected,
* but the user requested to run the command in background.
*
* NOTE that the case of a) CONFIG_SCHED_WAITPID is not selected and
* b) CONFIG_NSH_DISABLEBG selected cannot be supported. In that event, all
* commands will have to run in background. The waitpid() API must be
* available to support running the command in foreground.
* b) CONFIG_NSH_DISABLEBG selected cannot be supported. In that
* event, all commands will have to run in background. The waitpid()
* API must be available to support running the command in foreground.
*/
#if !defined(CONFIG_SCHED_WAITPID) || !defined(CONFIG_NSH_DISABLEBG)