aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/ps.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix/ps.c')
-rw-r--r--toys/posix/ps.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index e5adc192..4f8d75a9 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -980,6 +980,8 @@ static char *parse_rest(void *data, char *str, int len)
if (isdigit(*str)) {
ll[pl->len] = xstrtol(str, &end, 10);
if (end==(len+str)) num++;
+ // For pkill, -s 0 represents pkill's session id.
+ if (pl==&TT.ss && ll[pl->len]==0) ll[pl->len] = getsid(0);
}
if (pl==&TT.pp || pl==&TT.ss) {