With the privatization of the library xalloc functions,
this patch restores top's previous internal memory logic.
This puts us back on a 3.3.1 (and earlier) footing wherein
memory allocation errors carry these implications:
. if top detected, the terminal will be restored
prior to an abnormal exit and message
. if library detected, the terminal will become
corrupted following the message
To my knowledge, neither type of memory error has ever occurred
during the nine years since top was rewritten. So the issue of
restoring the termios structure is probably moot.
Pattern matching support in `sysctl: implement --pattern option'
commit did not work when variable path was defined, for example
$ sysctl net.ipv4 -r arp.ignore
gave no output. Reason being was tht the pattern was matched agains
the specified argument and not the output variable list.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
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.