Skip to content

Commit

Permalink
ps.1: restore always true if predicate
Browse files Browse the repository at this point in the history
Fixes:	62e6ca0
Reported and reviewed by:	jlduran
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D47561
  • Loading branch information
kostikbel committed Nov 14, 2024
1 parent 1426fd6 commit 092e2ff
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions bin/ps/ps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,6 @@ static void
saveuser(KINFO *ki)
{
char tdname[COMMLEN + 1];
char *argsp;

ki->ki_valid = 1;

Expand All @@ -1278,14 +1277,11 @@ saveuser(KINFO *ki)
if (needcomm) {
if (ki->ki_p->ki_stat == SZOMB) {
ki->ki_args = strdup("<defunct>");
} else if (ki->ki_p->ki_args != NULL) {
} else {
(void)snprintf(tdname, sizeof(tdname), "%s%s",
ki->ki_p->ki_tdname, ki->ki_p->ki_moretdname);
ki->ki_args = fmt(kvm_getargv, ki,
ki->ki_p->ki_comm, tdname, COMMLEN * 2 + 1);
} else {
asprintf(&argsp, "(%s)", ki->ki_p->ki_comm);
ki->ki_args = argsp;
}
if (ki->ki_args == NULL)
xo_errx(1, "malloc failed");
Expand Down

0 comments on commit 092e2ff

Please sign in to comment.