summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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>
* | docs: add rh analysis #2 information to contribSami Kerola2011-12-201-1/+1
| | | | | | | | | | | | Reference information. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | build-sys: enable xgettext TRANSLATORS commentsJim Warner2011-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* | sysctl: warn when separators are repeatedSami Kerola2011-12-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | sysctl: use libc error printing facilitiesSami Kerola2011-12-201-22/+22
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | vmstat: use libc error printing facilitiesSami Kerola2011-12-201-11/+6
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | pgrep: use libc error printing facilitiesSami Kerola2011-12-201-24/+18
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | libproc-ng & ps: fix warning reported by smatchSami Kerola2011-12-205-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | proc/ksym.c +279 read_file(54) info: redundant null check on buf calling free() proc/ksym.c +330 parse_ksyms(41) info: redundant null check on ksyms_data calling free() proc/ksym.c +332 parse_ksyms(43) info: redundant null check on ksyms_index calling free() proc/ksym.c +451 sysmap_mmap(110) info: redundant null check on sysmap_index calling free() proc/procps.h:74:5: warning: undefined preprocessor identifier 'SHARED' proc/slab.c +145 parse_slabinfo20(24) error: potential null derefence 'prev'. proc/slab.c +222 parse_slabinfo11(21) error: potential null derefence 'prev'. ps/stacktrace.c +131 debug(6) error: snprintf() is printing too much 99 vs 16 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | misc: compiler warning fixesSami Kerola2011-12-205-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | 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' Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | includes: add xalloc.h to unify memory allocationsSami Kerola2011-12-207-48/+94
| | | | | | | | | | | | | | The xalloc.h provides necessary error checking. Signed-off-by: Jim Warner <james.warner@comcast.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | ps: add gettext supportSami Kerola2011-12-2012-392/+311
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | watch: add gettext supportSami Kerola2011-12-201-29/+34
| | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>