mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-18 14:23:55 +00:00
Don't output state' and
current' fields for processes that aren't
leaders in -l option to jobs(1).
This commit is contained in:
parent
d982b3a5f6
commit
cb1a4fb419
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97819
|
@ -330,9 +330,9 @@ showjob(struct job *jp, int sformat, int lformat)
|
|||
}
|
||||
if (!lformat && ps != jp->ps)
|
||||
goto skip;
|
||||
if (jobno == curr)
|
||||
if (jobno == curr && ps == jp->ps)
|
||||
c = '+';
|
||||
else if (jobno == prev)
|
||||
else if (jobno == prev && ps == jp->ps)
|
||||
c = '-';
|
||||
else
|
||||
c = ' ';
|
||||
|
@ -348,7 +348,9 @@ showjob(struct job *jp, int sformat, int lformat)
|
|||
col += strlen(s);
|
||||
}
|
||||
s[0] = '\0';
|
||||
if (ps->status == -1) {
|
||||
if (ps != jp->ps) {
|
||||
*s = '\0';
|
||||
} else if (ps->status == -1) {
|
||||
strcpy(s, "Running");
|
||||
} else if (WIFEXITED(ps->status)) {
|
||||
fmtstr(s, 64, "Exit %d", WEXITSTATUS(ps->status));
|
||||
|
|
Loading…
Reference in a new issue