The option -v does not make much sense in pkill context.
Reported-By: "Jason A. Spiro" <jasonspiro4@gmail.com>
Bug-Debian: http://bugs.debian.org/558044
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
I as user often try to pkill something, notice that program did not
die and pkill again with signal -9. Before this commit previous one
could not add signal at the end of command line, as the signal
definition had to be first argument, which was annoying.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The c++ comments e.g. // should not be used in c code. Additionally
white spaces are converted to tabs as a small clean up.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Add new command line options -e, --echo to display what is
killed. Cost of this change is greater run time memory footprint,
because an union had to be changed to struct to allow name and
pid printing which what I as an user would expect to see in
verbose kill output.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
pgrep.c:786:4: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Print correct pid number of process that was where not killed
because of kill was not successful. Incorrect behaviour before
this fix is bello.
-- snip
$ ps -elf | grep dh[c]
1 S root 1409 1 0 80 0 - 1782 poll_s 02:01 ? 00:00:00 dhclient wlan0
$ pkill dhc
pkill: killing pid 1 failed: Operation not permitted
-- snip
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
err and warn are BSD format but they are not recommended by library
developers. However their consiseness is useful!
The solution is to use some macros that create xerr etc which then
just map to the error() function. The next problem is error() uses
program_invocation_name so we set this to program_invovation_short_name
This is a global set but seems to be the convention (or at least errors
are on the short name only) used everywhere else.
Add the following three functions to most of the commands.
setlocale (LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
Reference: http://www.freelists.org/post/procps/backporting,1
Reported-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>