pkill(1): Add option -T to restrict to current terminal
authorLevente Kurusa <lkurusa@acm.org>
Tue, 4 Dec 2018 22:07:52 +0000 (23:07 +0100)
committerAaron LI <aly@aaronly.me>
Wed, 10 Mar 2021 15:07:18 +0000 (23:07 +0800)
commita2d71d01f5b798e1d53f2052232e39f6d185faf6
treea6308039958590688474aba72bba13874591059a
parent4ec80808ee5a1c16afe989ec48daa6ed3bf8873c
pkill(1): Add option -T to restrict to current terminal

This option is introduced for feature parity with killall(1) where it
restricts to matching processes in the current terminal by specifying
the -T option.  While this is achievable via pkill(1)'s -t option, for
feature parity and convenience, this commit implements the -T option.

Signed-off-by: Levente Kurusa <lkurusa@kernelstuff.org>
(aly)
I've reviewed and revised the original patch:
* Adjust the option orders in code and in the man page.
* Check and copy the return of ttyname(), which can be NULL and is a
  internal static buffer.
* Make option '-t' accept a full path to the terminal device.  This
  simplifies the code by avoiding the strip of "/dev/".  Meanwhile
  update the man page accordingly.
* Fix some minor issues in the original patch.

DragonFly-bug: #3163
usr.bin/pkill/pkill.1
usr.bin/pkill/pkill.c