]> granicus.if.org Git - procps-ng/commitdiff
pkill: Add lt- variants
authorCraig Small <csmall@dropbear.xyz>
Mon, 5 Apr 2021 04:40:00 +0000 (14:40 +1000)
committerCraig Small <csmall@dropbear.xyz>
Mon, 5 Apr 2021 04:40:00 +0000 (14:40 +1000)
The pgrep code checks to see if the program is run as pkill or pidwait
and changes its behaviour accordingly.  Some older versions of libtool
run the programs as lt-pkill and lt-pidwait which means the tests fail.

We add these two program names to the checks.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
NEWS
pgrep.c

diff --git a/NEWS b/NEWS
index 7e71021ac6ac7b2e1c731674c641260dd727008a..83918e3c6180e6aaf9c3d20096c7400674376e45 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ procps-ng-NEXT
 ---------------
   * Rename pwait to pidwait
   * library: renamed to libproc-2 and reset to 0:0:0
+  * pkill: Check for lt- variants of program name          issue #192
   * ps: Add OOM and OOMADJ fields                          issue #198
   * slabtop: Don't combine d and o options                 issue #160
 
diff --git a/pgrep.c b/pgrep.c
index 0fd85b7c4de9b913c1eb75b3b20c3a548286260e..90e42211885d73c8da6c00f4ce304daa66755d55 100644 (file)
--- a/pgrep.c
+++ b/pgrep.c
@@ -750,12 +750,14 @@ static void parse_opts (int argc, char **argv)
     };
 
 #ifdef ENABLE_PIDWAIT
-    if (strcmp (program_invocation_short_name, "pidwait") == 0) {
+    if (strcmp (program_invocation_short_name, "pidwait") == 0 ||
+        strcmp (program_invocation_short_name, "lt-pidwait") == 0) {
         prog_mode = PIDWAIT;
         strcat (opts, "e");
     } else
 #endif
-    if (strcmp (program_invocation_short_name, "pkill") == 0) {
+    if (strcmp (program_invocation_short_name, "pkill") == 0 ||
+        strcmp (program_invocation_short_name, "lt-pkill") == 0) {
         int sig;
         prog_mode = PKILL;
         sig = signal_option(&argc, argv);