1303 files changed, 32187 insertions, 57138 deletions
diff --git a/procps/pgrep.c b/procps/pgrep.c index 4ab458b..ac82b51 100644 --- a/procps/pgrep.c +++ b/procps/pgrep.c @@ -6,6 +6,23 @@ * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ +//config:config PGREP +//config: bool "pgrep" +//config: default y +//config: help +//config: Look for processes by name. +//config: +//config:config PKILL +//config: bool "pkill" +//config: default y +//config: help +//config: Send signals to processes by name. + +//applet:IF_PGREP(APPLET(pgrep, BB_DIR_USR_BIN, BB_SUID_DROP)) +//applet:IF_PKILL(APPLET_ODDNAME(pkill, pgrep, BB_DIR_USR_BIN, BB_SUID_DROP, pkill)) + +//kbuild:lib-$(CONFIG_PGREP) += pgrep.o +//kbuild:lib-$(CONFIG_PKILL) += pgrep.o //usage:#define pgrep_trivial_usage //usage: "[-flnovx] [-s SID|-P PPID|PATTERN]" @@ -106,8 +123,7 @@ int pgrep_main(int argc UNUSED_PARAM, char **argv) /* Parse remaining options */ ppid2match = -1; sid2match = -1; - opt_complementary = "s+:P+"; /* numeric opts */ - opt = getopt32(argv, "vlfxons:P:", &sid2match, &ppid2match); + opt = getopt32(argv, "vlfxons:+P:+", &sid2match, &ppid2match); argv += optind; if (pkill && OPT_LIST) { /* -l: print the whole signal list */ @@ -150,9 +166,9 @@ int pgrep_main(int argc UNUSED_PARAM, char **argv) } } - if (ppid2match >= 0 && (pid_t) ppid2match != (pid_t) proc->ppid) + if (ppid2match >= 0 && ppid2match != proc->ppid) continue; - if (sid2match >= 0 && sid2match != (int) proc->sid) + if (sid2match >= 0 && sid2match != proc->sid) continue; /* NB: OPT_INVERT is always 0 or 1 */ |