summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* top: with lib xalloc changes, restored prior memory logicJim Warner2011-12-222-12/+39
| | | | | | | | | | | | | | | | 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.
* sysctl: enable pattern matching with pathSami Kerola2011-12-201-5/+5
| | | | | | | | | | | | 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>
* watch: use strtod_or_err() to validate user inputSami Kerola2011-12-202-11/+7
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tload: validate scale argumentSami Kerola2011-12-201-6/+5
| | | | | | | | | Earlier version crashed when negative value was provided. $ tload -s -1 Segmentation fault Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib: add strtod_or_err()Sami Kerola2011-12-202-0/+25
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* pwdx: write errors to stderrSami Kerola2011-12-201-1/+3
| | | | | | | 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>
* slabtop: use strutils.c to validate user inputSami Kerola2011-12-202-7/+5
| | | | | | | | | | | | 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>
* vmstat: validate numeric user input and allow infinte updatesSami Kerola2011-12-202-9/+19
| | | | | | | | | 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>
* tload: validate numeric user inputSami Kerola2011-12-202-2/+10
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sysctl: exit with error message instead of usage()Sami Kerola2011-12-201-16/+16
| | | | | | Printing usage() output at error is too noisy. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: add exit values to pmap manual pageSami Kerola2011-12-201-0/+15
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* pgrep: exit with error message instead of usage()Sami Kerola2011-12-201-13/+15
| | | | | | Printing usage() output at error is too noisy. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: clean up ps.1 manual pageSami Kerola2011-12-201-805/+1114
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* nls: improve translations and provide translator help commentsSami Kerola2011-12-2015-49/+153
| | | | | | 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>
* other: tell what was taken from util-linux packageSami Kerola2011-12-205-0/+20
| | | | | | 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>
* nls: add functions which take translations to be usedSami Kerola2011-12-2011-4/+45
| | | | | | | | | | | | 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>
* skill: use rpmatch() to yes/no questionSami Kerola2011-12-202-6/+10
| | | | | | | | 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>
* vmstats: fix coding styleSami Kerola2011-12-201-605/+641
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* dosc: add long options to skill.1Sami Kerola2011-12-201-22/+22
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: add long options to kill.1Sami Kerola2011-12-201-9/+9
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* skill: fix compiler warningsSami Kerola2011-12-201-35/+27
| | | | | | | | | | | 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>
* skill: add long options to usage outputSami Kerola2011-12-201-21/+23
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* skill: support usage output to stdout & stderrSami Kerola2011-12-201-46/+46
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* skill: use symbolic exit valuesSami Kerola2011-12-201-7/+5
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* skill: use strtosig() for -l option argumentSami Kerola2011-12-202-3/+9
| | | | | | | | 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>
* libproc-ng: add strtosig() functionSami Kerola2011-12-202-0/+45
| | | | | | | | 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>
* skill: add long optionsSami Kerola2011-12-201-82/+54
| | | | | | | | | 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>
* skill: warning printout for non-existing processesSami Kerola2011-12-201-3/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* skill: add long options & new debugging optionSami Kerola2011-12-201-154/+114
| | | | | | | | | 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>
* skill: parse kill signals separatelySami Kerola2011-12-201-11/+24
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* skill: use strtol_or_err to nice argument parsingSami Kerola2011-12-202-20/+41
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* lib: add strtol into utility librarySami Kerola2011-12-206-0/+50
| | | | | | | | | 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>
* skill: remove run time configuration global variablesSami Kerola2011-12-201-35/+44
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* skill: move usage functions near each otherSami Kerola2011-12-201-51/+49
| | | | | | Done only for convenience. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* skill: clean up which functionality is being calledSami Kerola2011-12-201-20/+19
| | | | | | | | 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>
* skill: reindent the fileSami Kerola2011-12-201-439/+545
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: use Makevars --add-comments= to limit .pot commentsJim Warner2011-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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 ""
* build-sys: we don't need wide-ncurses, what were we thinking?Jim Warner2011-12-201-2/+2
| | | | | | | | | | | . 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.
* build-sys: added config.h include to nls.h (for PACKAGE str)Jim Warner2011-12-201-0/+4
|
* build-sys: added tabs to AC_CONFIG_FILES for consistencyJim Warner2011-12-201-7/+8
|
* build-sys: alphabeticized strverscmp in AC_CHECK_FUNCSJim Warner2011-12-201-1/+1
|
* build-sys: added some missing files to AC_CHECK_HEADERSJim Warner2011-12-201-0/+2
|
* slabtop: added remaining missing nls supportJim Warner2011-12-201-0/+5
|
* free: added remaining missing nls supportJim Warner2011-12-201-0/+6
|
* misc: trailing space/tab cleanup following rebaseJim Warner2011-12-201-1/+1
|
* build-sys: corrected/simplified ncurses support detectionJim Warner2011-12-201-16/+7
|
* pmap: correct 'rh analysis #2' patch and contrib documentJim Warner2011-12-201-1/+2
|
* build-sys: verify gettext is present in autogen.shSami Kerola2011-12-201-0/+7
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: add missing files to distributionSami Kerola2011-12-203-0/+6
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: remove non-existing files from Makefile.amSami Kerola2011-12-201-3/+1
| | | | | | | | 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>