Jim Warner [Tue, 20 Dec 2011 14:23:37 +0000 (08:23 -0600)]
top: with lib xalloc changes, restored prior memory logic
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.
Sami Kerola [Sun, 18 Dec 2011 13:55:30 +0000 (14:55 +0100)]
vmstat: validate numeric user input and allow infinte updates
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.
Sami Kerola [Sat, 17 Dec 2011 17:32:47 +0000 (18:32 +0100)]
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>
Sami Kerola [Wed, 7 Dec 2011 12:43:34 +0000 (13:43 +0100)]
other: tell what was taken from util-linux 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>
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>
Sami Kerola [Sat, 22 Oct 2011 16:05:42 +0000 (18:05 +0200)]
libproc-ng: add strtosig() function
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.
Sami Kerola [Sat, 22 Oct 2011 10:20:35 +0000 (12:20 +0200)]
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.
Sami Kerola [Tue, 18 Oct 2011 18:54:30 +0000 (20:54 +0200)]
lib: add strtol into utility library
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.
Jim Warner [Sun, 6 Nov 2011 23:08:02 +0000 (17:08 -0600)]
build-sys: use Makevars --add-comments= to limit .pot comments
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 ""
Jim Warner [Fri, 28 Oct 2011 13:37:30 +0000 (08:37 -0500)]
build-sys: we don't need wide-ncurses, what were we thinking?
. 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.
Sami Kerola [Sun, 9 Oct 2011 20:45:59 +0000 (22:45 +0200)]
misc: compiler warning fixes
Fix few compiler warnings. Some of these warnings appeared multiple
times, and the listing bellow is more about which sort of errors
where fixed.
devname.c:87:12: warning: comparison of integers of different signs: 'int' and 'unsigned long'
output.c:389:36: warning: passing 'char **const' to parameter of type 'const char *const restrict *' discards qualifiers in nested pointer types
output.c:611:31: warning: comparison of integers of different signs: 'const unsigned long' and 'int'
stacktrace.c:33:37: warning: unused parameter 'signum'
Ludwig Nussel [Fri, 7 Oct 2011 07:10:49 +0000 (09:10 +0200)]
sysctl: add --system switch
instead of requiring distributions to construct a loop around sysctl
in boot scripts just scan a set of default directories if the --system
switch is used.
Config files are applied in alphabetic order of their base name.
Each base name is only applied once according to the directory
preference. /etc/sysctl.conf is always applied last.
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Sami Kerola [Sun, 5 Jun 2011 11:23:15 +0000 (13:23 +0200)]
include/devname.h: add missing header
The devname.h requires readproc.h header which has dev_t. Unless
header is included the includes in program files must be in
correct order. I also added FIXME item to remind that for uid &
gid value int not correct data type but uid_t or gid_t from
pwd.h.
Sami Kerola [Sun, 5 Jun 2011 17:46:49 +0000 (19:46 +0200)]
sysctl: options handling & usage output
The sysctl now uses getopt_long and has help screen which be user
friendly. Rest of the modernization is left later, since this is
a command is used in scripts, and changing for instance error
printing to use warn & warnx could break stuff.