diff options
Diffstat (limited to 'procps/pgrep.c')
-rw-r--r-- | procps/pgrep.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/procps/pgrep.c b/procps/pgrep.c index 1c594cf96..ac82b5156 100644 --- a/procps/pgrep.c +++ b/procps/pgrep.c | |||
@@ -6,6 +6,23 @@ | |||
6 | * | 6 | * |
7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
8 | */ | 8 | */ |
9 | //config:config PGREP | ||
10 | //config: bool "pgrep" | ||
11 | //config: default y | ||
12 | //config: help | ||
13 | //config: Look for processes by name. | ||
14 | //config: | ||
15 | //config:config PKILL | ||
16 | //config: bool "pkill" | ||
17 | //config: default y | ||
18 | //config: help | ||
19 | //config: Send signals to processes by name. | ||
20 | |||
21 | //applet:IF_PGREP(APPLET(pgrep, BB_DIR_USR_BIN, BB_SUID_DROP)) | ||
22 | //applet:IF_PKILL(APPLET_ODDNAME(pkill, pgrep, BB_DIR_USR_BIN, BB_SUID_DROP, pkill)) | ||
23 | |||
24 | //kbuild:lib-$(CONFIG_PGREP) += pgrep.o | ||
25 | //kbuild:lib-$(CONFIG_PKILL) += pgrep.o | ||
9 | 26 | ||
10 | //usage:#define pgrep_trivial_usage | 27 | //usage:#define pgrep_trivial_usage |
11 | //usage: "[-flnovx] [-s SID|-P PPID|PATTERN]" | 28 | //usage: "[-flnovx] [-s SID|-P PPID|PATTERN]" |
@@ -151,7 +168,7 @@ int pgrep_main(int argc UNUSED_PARAM, char **argv) | |||
151 | 168 | ||
152 | if (ppid2match >= 0 && ppid2match != proc->ppid) | 169 | if (ppid2match >= 0 && ppid2match != proc->ppid) |
153 | continue; | 170 | continue; |
154 | if (sid2match >= 0 && sid2match != proc->sid) | 171 | if (sid2match >= 0 && sid2match != proc->sid) |
155 | continue; | 172 | continue; |
156 | 173 | ||
157 | /* NB: OPT_INVERT is always 0 or 1 */ | 174 | /* NB: OPT_INVERT is always 0 or 1 */ |