This is an automated email from the ASF dual-hosted git repository. acassis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit ef702ab5af64ec91eaee774cf5a719174f550328 Author: yukangzhi <[email protected]> AuthorDate: Tue Nov 17 14:15:51 2026 +0800 nshlib/nsh_proccmds: fix pre-existing nxstyle errors. Fix the existing nxstyle errors in nsh_proccmds.c so that the file passes the whole-file style check: indent the case labels of two switch statements in cmd_kill() and cmd_pkill(), and add the missing blank lines after declarations. Whitespace only, no functional change. Assisted-by: Kiro Signed-off-by: yukangzhi <[email protected]> --- nshlib/nsh_proccmds.c | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/nshlib/nsh_proccmds.c b/nshlib/nsh_proccmds.c index 8be9fe2d2..dfe3c25de 100644 --- a/nshlib/nsh_proccmds.c +++ b/nshlib/nsh_proccmds.c @@ -238,6 +238,7 @@ static void nsh_parse_statusline(FAR char *line, else if (strncmp(line, g_priority, strlen(g_priority)) == 0) { FAR char *ptr = nsh_trimspaces(&line[12]); + status->td_priority = ptr; /* If priority inheritance is enabled, use current pri, ignore base */ @@ -1044,6 +1045,7 @@ int cmd_ps(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) for (i = 1; i < argc; i++) { struct dirent entry; + if (!isdigit(*argv[i])) { continue; @@ -1178,18 +1180,18 @@ int cmd_kill(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) switch (errno) { - case EINVAL: - goto invalid_arg; + case EINVAL: + goto invalid_arg; - case ESRCH: - nsh_error(vtbl, g_fmtnosuch, argv[0], "task", argv[2]); - return ERROR; + case ESRCH: + nsh_error(vtbl, g_fmtnosuch, argv[0], "task", argv[2]); + return ERROR; - case EPERM: - case ENOSYS: - default: - nsh_error(vtbl, g_fmtcmdfailed, argv[0], "kill", NSH_ERRNO); - return ERROR; + case EPERM: + case ENOSYS: + default: + nsh_error(vtbl, g_fmtcmdfailed, argv[0], "kill", NSH_ERRNO); + return ERROR; } invalid_arg: @@ -1276,18 +1278,18 @@ int cmd_pkill(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) { switch (errno) { - case EINVAL: - goto invalid_arg; - - case ESRCH: - nsh_error(vtbl, g_fmtnosuch, argv[0], "task", argv[2]); - return ERROR; - - case EPERM: - case ENOSYS: - default: - nsh_error(vtbl, g_fmtcmdfailed, argv[0], "kill", NSH_ERRNO); - return ERROR; + case EINVAL: + goto invalid_arg; + + case ESRCH: + nsh_error(vtbl, g_fmtnosuch, argv[0], "task", argv[2]); + return ERROR; + + case EPERM: + case ENOSYS: + default: + nsh_error(vtbl, g_fmtcmdfailed, argv[0], "kill", NSH_ERRNO); + return ERROR; } } } @@ -1535,6 +1537,7 @@ int cmd_top(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) while (pid != NULL && ret >= 0) { struct dirent entry; + entry.d_type = DT_DIR; strlcpy(entry.d_name, pid, sizeof(entry.d_name)); ret = top_callback(vtbl, CONFIG_NSH_PROC_MOUNTPOINT,
