Commit Graph

47 Commits

Author SHA1 Message Date
Sami Kerola
8cd53e16b5 skill: ensure optarg is not null [smatch scan]
skill.c:549 skillsnice_parse(87) error: we previously assumed 'optarg' could be null (see line 539)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-05 20:54:58 +01:00
Craig Small
8955ec26fe Merge remote-tracking branch 'sami/vapier' 2012-01-24 22:36:28 +11:00
Mike Frysinger
afaf698896 use helpers from c.h
A few files still use the C library helpers from err.h, so migrate
them to the local c.h helpers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-24 08:55:05 +01:00
Sami Kerola
7fc80ffa42 skill: exclude debugging strings from nls
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-22 01:23:59 +01:00
Sami Kerola
79ceb30b5c ps: unify cases and remove trailing dots in messages
Strings with lower caps & no trailing dots have greater change to
have multiple occurences, meaning less effort for translators, than
strings with them.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-15 20:52:58 +01:00
Craig Small
fb11e1fe0a Changed the err and warns to macros
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.
2012-01-03 18:48:43 +11:00
Sami Kerola
c3405fab1a translations: group usage texts
Reference: http://www.freelists.org/post/procps/backporting,5
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-02 16:29:03 +11:00
Sami Kerola
0022b6ec5d nls: improve translations and provide translator help comments
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>
2011-12-20 17:30:54 +01:00
Sami Kerola
c862a4caa5 nls: add functions which take translations to be used
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>
2011-12-20 17:30:53 +01:00
Sami Kerola
b40353c91e skill: use rpmatch() to yes/no question
The patch also removes fixed size of input, which can be problematic.
I do not know how long the string `yes' might be in all of the worlds
languages.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:53 +01:00
Sami Kerola
1ac2921f6f skill: fix compiler warnings
Pretty much all of the warnings where caused by some of the previous
patches, and they became visible with gcc when compiling with;

CFLAGS="-O -g -ggdb -Wall -Wextra -pedantic -Wstrict-overflow
	-Wformat -Wswitch-default -Wswitch-enum -Wsync-nand
	-Wredundant-decls -Wuninitialized"

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:53 +01:00
Sami Kerola
d8d94a87ef skill: add long options to usage output
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:53 +01:00
Sami Kerola
4ea27a7716 skill: support usage output to stdout & stderr
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:53 +01:00
Sami Kerola
89e1a83c07 skill: use symbolic exit values
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:53 +01:00
Sami Kerola
8b8149ba60 skill: use strtosig() for -l option argument
Re-enable signal number to name string, and other way around,
conversion after it broke at the time when long options where
introduced.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:53 +01:00
Sami Kerola
a45a1c6c88 skill: add long options
This commit broke `-l <sig>' conversion, which needs to be fixed
before kill can be claimed to work similar enough way as it did
earlier.  The fix require libprocps change, because the current
print_given_signals() simply does not work in this case.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:53 +01:00
Sami Kerola
b4b73df69c skill: warning printout for non-existing processes
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:52 +01:00
Sami Kerola
991b8a94f0 skill: add long options & new debugging option
Done for skillsnice_parse(), meaning the kill needs functionality
will be done later.

This commit also introduces new debugging option.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:52 +01:00
Sami Kerola
61094186fe skill: parse kill signals separately
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:52 +01:00
Sami Kerola
723ce0dc74 skill: use strtol_or_err to nice argument parsing
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:52 +01:00
Sami Kerola
130895b02e skill: remove run time configuration global variables
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:52 +01:00
Sami Kerola
9e3203203f skill: move usage functions near each other
Done only for convenience.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:52 +01:00
Sami Kerola
4c8446dc55 skill: clean up which functionality is being called
The skill.c is three different commands depending on how the
executable is named. This patch makes evaluation of the command name
cleaner.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:52 +01:00
Sami Kerola
57f290dcb4 skill: reindent the file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:52 +01:00
Sami Kerola
1ef14f4bf9 includes: add xalloc.h to unify memory allocations
The xalloc.h provides necessary error checking.

Signed-off-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:30:50 +01:00
Sami Kerola
84c9e5fbf5 skill: add gettext support
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:17:04 +01:00
Sami Kerola
b6578cb372 skill: new usage function
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-20 17:17:03 +01:00
Justin Pryzby
db4751c216 skill: kill prints perror
A patch from Debian.

Bug-Debian: http://bugs.debian.org/468363
Backported-by: Sami Kerola <kerolasa@iki.fi>
2011-12-18 22:52:03 +11:00
WANG Yunfeng
15b853c02b skill: do not treat skill null parameter as 0
A patch from Debian.

Bug-Debian: http://bugs.debian.org/551173
Backported-by: Sami Kerola <kerolasa@iki.fi>
2011-12-18 22:51:32 +11:00
Craig Small
057f895529 skill: fix too greedy option parser
Patch based on submitted patch by Yoshio Nakamura

A patch from Debian.

Bug-Debian: http://bugs.debian.org/331419
Bug-Debian: http://bugs.debian.org/569030
Backported-by: Sami Kerola <kerolasa@iki.fi>
2011-12-18 22:50:58 +11:00
Craig Small
86fb879a0d skill: add CR to warning line
A patch from Debian.

Bug-Debian: http://bugs.debian.org/331419
Bug-Debian: http://bugs.debian.org/331419
Backported-by: Sami Kerola <kerolasa@iki.fi>
2011-12-18 22:26:24 +11:00
Jim Warner
f9ae59f5df libtool accommodation: kill, skill, snice 2011-10-11 09:57:01 +02:00
albert
fcc376b861 note UNIX standard self-conflict 2008-03-24 05:57:28 +00:00
albert
59fc9dd711 %cpu and other changes 2004-09-12 15:43:48 +00:00
albert
f1db79c042 better handling of long usernames 2004-07-20 23:31:12 +00:00
albert
360e6533c9 misc 2003-08-16 21:15:53 +00:00
albert
3e67b58ec2 satisfy GPL section 2a and LGPL section 2b name+date requirement 2002-12-15 00:30:17 +00:00
albert
b657e7e08a NORETURN 2002-12-09 07:53:09 +00:00
albert
5087f3dbf6 big header clean-up 2002-12-09 07:00:07 +00:00
albert
7ac9a0e1f5 present for Jim 2002-12-03 09:07:59 +00:00
albert
80b73a78e4 c99 warnings again 2002-11-27 08:36:03 +00:00
albert
ade43a692b c99 -- ugh, this is HARD 2002-11-27 08:21:30 +00:00
albert
f40af35b77 c99 2002-11-25 21:36:43 +00:00
albert
465708e3f9 perfect but for extra /usr/bin/kill 2002-10-10 22:40:35 +00:00
albert
065a486ccc skill -n testing-some-stuff #158630 2002-10-10 20:04:42 +00:00
csmall
cca86db7ba added version stuff for kill and pgrep, tried to understand alberts groff and failed 2002-10-03 23:08:14 +00:00
csmall
03a9b5a30f procps 010114 2002-02-01 22:47:29 +00:00