From: Craig Small Date: Sun, 29 Apr 2007 23:05:33 +0000 (+0000) Subject: killall message change X-Git-Tag: v22.11~60 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a59bcfb816f1fbf99d6ed9ebb97f3ec1c833f232;p=psmisc killall message change --- diff --git a/ChangeLog b/ChangeLog index a3c7efb..662a767 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,8 @@ Changes in ?? ============= -2007-04-30 Benno Schulenberg - * Fixed up NLS for fuser +2007-04-30 Craig Small + * Fixed up NLS for fuser, patch from Benno Schulenberg + * killall asks for Signal (procname) if not SIGTERM Changes in 22.5 =============== diff --git a/src/killall.c b/src/killall.c index 1c953fa..60f3430 100644 --- a/src/killall.c +++ b/src/killall.c @@ -2,7 +2,7 @@ * killall.c - kill processes by name or list PIDs * * Copyright (C) 1993-2002 Werner Almesberger - * Copyright (C) 2002-2005 Craig Small + * Copyright (C) 2002-2007 Craig Small * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ static int verbose = 0, exact = 0, interactive = 0, reg = 0, ignore_case = 0, pidof; static int -ask (char *name, pid_t pid) +ask (char *name, pid_t pid, const int signal) { int res; size_t len; @@ -70,8 +70,13 @@ ask (char *name, pid_t pid) len = 0; do { - printf (_("Kill %s(%s%d) ? (y/N) "), name, process_group ? "pgid " : "", - pid); + if (signal == SIGTERM) + printf (_("Kill %s(%s%d) ? (y/N) "), name, process_group ? "pgid " : "", + pid); + else + printf (_("Signal %s(%s%d) ? (y/N) "), name, process_group ? "pgid " : "", + pid); + fflush (stdout); if (getline (&line, &len, stdin) < 0) @@ -425,7 +430,7 @@ kill_all (int signal, int names, char **namelist, struct passwd *pwent) if (j < i) continue; } - if (interactive && !ask (comm, id)) + if (interactive && !ask (comm, id, signal)) continue; if (pidof) {