Skip to content

Commit 761f25c

Browse files
michallencxiaoxiang781216
authored andcommitted
nshlib/nsh_proccmds.c: fix description for TID and switch order
ID previously marked as PID was in fact TID. PID was hidden under GROUP column. This fixes the description. The order of TID, PPID, PID is also changed to more logical TID, PID, PPID. Signed-off-by: Michal Lenc <michallenc@seznam.cz>
1 parent 91a7580 commit 761f25c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

nshlib/nsh_proccmds.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ struct nsh_taskstatus_s
100100
FAR const char *td_sigmask; /* Signal mask */
101101
#endif
102102
FAR char *td_cmdline; /* Command line */
103-
int td_pid; /* Task ID */
103+
int td_tid; /* Task ID */
104104
int td_ppid; /* Parent task ID */
105105
#ifdef NSH_HAVE_CPULOAD
106106
FAR const char *td_cpuload; /* CPU load */
@@ -379,7 +379,7 @@ static int ps_record(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath,
379379
status->td_sigmask = "";
380380
#endif
381381
status->td_cmdline = "";
382-
status->td_pid = atoi(entryp->d_name);
382+
status->td_tid = atoi(entryp->d_name);
383383
status->td_ppid = INVALID_PROCESS_ID;
384384
#ifdef NSH_HAVE_CPULOAD
385385
status->td_cpuload = "";
@@ -633,7 +633,7 @@ static void ps_title(FAR struct nsh_vtbl_s *vtbl, bool heap)
633633
"%6s "
634634
#endif
635635
"%s\n"
636-
, "PID", "PPID", "GROUP"
636+
, "TID", "PID", "PPID"
637637
#ifdef CONFIG_SMP
638638
, "CPU"
639639
#endif
@@ -679,7 +679,7 @@ static void ps_output(FAR struct nsh_vtbl_s *vtbl, bool heap,
679679
#endif
680680

681681
nsh_output(vtbl,
682-
"%5d %5d %5s "
682+
"%5d %5s %5d "
683683
#ifdef CONFIG_SMP
684684
"%3s "
685685
#endif
@@ -700,7 +700,7 @@ static void ps_output(FAR struct nsh_vtbl_s *vtbl, bool heap,
700700
"%5s "
701701
#endif
702702
"%s\n"
703-
, status->td_pid, status->td_ppid, status->td_groupid
703+
, status->td_tid, status->td_groupid, status->td_ppid
704704
#ifdef CONFIG_SMP
705705
, status->td_cpu
706706
#endif

0 commit comments

Comments
 (0)