Includes also magic number removal (return value 1 to EXIT_FAILURE),
and proper null assignment to end of string.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit fixes also peculiar behavior of
$ slabtop -d 0
which did not make sense. The fix is to disallow anything else but
positive integers, which includes zero as is is not positive (or
negative) number.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The vmstat used ULONG_MAX as definition of infinite updates. On a
computer with mighty uptime one will find that after 136 years
(assuming 1 second update interval) the vmstat exits, which is in
conflict with a promise of infinite.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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>
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>
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>
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>
The function will convert a signal number string to a signal name, or
vice a verse. Return value is string, which is an function user is
expected to free after use.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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>
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>
The utility library is for functions which are shared in commands,
but that does not belong to libproc-ng. The first function is a
wrapper for strtol that performs error checking, and exists if such
happen.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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>
By not limiting --add-comments= via an argument, xgettext is far
too aggressive (one might say stupid) when extracting comments.
It doesn't even limit extraction to a single preceeding comment.
Here is an example showing a program source excerpt and the
resulting .pot excerpt:
--- program source ----------------------------------------
close (0); dup (in_fd[0]); /* set the stdin to the in pipe */
close (1); dup (out_fd[1]); /* set the stdout to the out pipe */
close (2); dup (out_fd[1]); /* set the stderr to the out pipe */
execvp (args[0], args); /* exec gdb */
perror (_("exec failed"));
--- resulting .pot ----------------------------------------
#. set the stdin to the in pipe
#. set the stdout to the out pipe
#. set the stderr to the out pipe
#. exec gdb
#: ps/stacktrace.c:28 ps/stacktrace.c:63
msgid "exec failed"
msgstr ""
. 1 program uses curses (top)
. 2 programs use ncurses (slabtop, watch)
. all 3 include non-wide <curses.h> or <ncurses.h>
. those 3 do not currently need wide support
. but anticipating nls, we link against libncursesw
This patch ensures an environment consistent with current
and future ncurses needs.
The f23390043bece9f2d4870e5b3a187896e2c7d23f removed few files,
which still exist in Makefile.am making `make dist' to fail. This
patch fixes the isue.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit will enable pass comments to translators near gettext
directive to .pot file. For example;
/* TRANSLATORS: this is visible in .pot file */
printf(_("to be translated"));
Signed-off-by: Jim Warner <james.warner@comcast.net>
For some reason sysctl earlier allowed quite strange separators.
% sysctl kernel./.pty.nr
kernel./.pty.nr = 6
% sysctl kernel///pty//////////nr
kernel...pty..........nr = 6
This commit does not disallow that sort of constructs, but will warn
about them. In future disallowing these might be reasonable thing to
do.
% sysctl kernel./.pty.nr
sysctl: separators should not be repeated: ./.pty.nr
kernel./.pty.nr = 6
Signed-off-by: Sami Kerola <kerolasa@iki.fi>