Commit Graph

896 Commits

Author SHA1 Message Date
Sami Kerola
30b3c4958c vmstat: open file should be closed, not freed
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-05 23:15:54 +01:00
Sami Kerola
cbb9e54587 pmap: ensure arg1 is not null, and set qualifers to match with usage [smatch scan]
pmap.c:436 main(59) error: we previously assumed 'arg1' could be null (see line 427)
pmap.c:136:3: warning: return discards 'const' qualifier from pointer target type [enabled by default]
pmap.c:142:4: warning: return discards 'const' qualifier from pointer target type [enabled by default]
pmap.c:150:2: warning: return discards 'const' qualifier from pointer target type [enabled by default]
pmap.c:300:8: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-05 21:43:36 +01:00
Sami Kerola
b2ebca4a60 pgrep: fix potential null derefences [smatch scan]
pgrep.c:137 split_list(19) error: potential null derefence 'list'.
pgrep.c:540 select_procs(106) error: potential null derefence 'list'.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-05 21:13:36 +01:00
Sami Kerola
1689e769e6 sysctl: fix potential null derefence [smatch scan]
sysctl.c:560 PreloadSystem(29) error: potential null derefence 'cfgs'.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-05 21:02:34 +01:00
Sami Kerola
8cd53e16b5 skill: ensure optarg is not null [smatch scan]
skill.c:549 skillsnice_parse(87) error: we previously assumed 'optarg' could be null (see line 539)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-05 20:54:58 +01:00
Sami Kerola
ffe5e0b08e watch: remove unreachable code
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-05 20:48:33 +01:00
Sami Kerola
c686e4c4dc pwdx: free memory before exit
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-05 20:44:39 +01:00
Sami Kerola
8fe81caa42 sysctl: fix coding style
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-25 09:18:38 +01:00
Sami Kerola
1cde286c75 docs: add to pgrep.1 count return value information
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-25 09:17:49 +01:00
Sami Kerola
da20fcbe42 docs: remove tcp_default_win_scale from sysctl.conf sample
The variable net.ipv4.tcp_default_win_scale has not been part of
kernel since 2.6.9 (Oct 2004).

Reference: http://oss.sgi.com/archives/netdev/2004-08/msg01589.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-24 22:34:12 +01:00
Sami Kerola
ea221b4e42 libprocps: hide private symbols
Clean the global list of symbols contain only functions and variables which
are being called from library.  The removed symbols are internal for the
library, which means they can be changed without changes to programs using
the library.  This clean up should help incoming libprocps clean up work.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-24 21:54:01 +01:00
Craig Small
8955ec26fe Merge remote-tracking branch 'sami/vapier' 2012-01-24 22:36:28 +11:00
Mike Frysinger
9c32fdbec3 ps: include error.h
This code currently uses error_at_line() from error.h, so pull it in.
Long term, this might get moved to c.h as a local helper on err.h,
but I have no idea.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-24 08:55:05 +01:00
Mike Frysinger
2b449855c7 proc: pull in ctype.h where needed
Fix the build warnings:

sig.c:227:5: warning: implicit declaration of function 'toupper' [-Wimplicit-function-declaration]
sig.c:231:3: warning: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-24 08:55:05 +01:00
Mike Frysinger
afaf698896 use helpers from c.h
A few files still use the C library helpers from err.h, so migrate
them to the local c.h helpers.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-24 08:55:05 +01:00
Mike Frysinger
13d8cc0681 watch: include sys/wait.h for waitpid
Fixes build warning:
	watch.c:682:3: warning: implicit declaration of
		function 'waitpid' [-Wimplicit-function-declaration]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-24 08:55:05 +01:00
Mike Frysinger
af61809a18 include error.h for error() and friends
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-24 08:55:05 +01:00
Sami Kerola
7fc80ffa42 skill: exclude debugging strings from nls
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-22 01:23:59 +01:00
Sami Kerola
2b99362139 tload: remove unnecessary goto
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-21 23:29:02 +01:00
Sami Kerola
8f7eefc9c8 docs: aligh top.1 header with other procps-ng utils
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-21 16:49:47 +01:00
Sami Kerola
624773957f docs: add exit values to watch.1
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-21 16:41:31 +01:00
Sami Kerola
ae08eb8af6 tload: check write() return value
Exit at rare events when writing to tty is unsuccessful.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-21 16:24:33 +01:00
Sami Kerola
bc974b3c33 pkill: enable displaying what is killed
Add new command line options -e, --echo to display what is
killed. Cost of this change is greater run time memory footprint,
because an union had to be changed to struct to allow name and
pid printing which what I as an user would expect to see in
verbose kill output.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-21 13:44:00 +01:00
Sami Kerola
12dce9f83b pgrep: fix compiler warning
pgrep.c:786:4: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'int' [-Wformat]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-21 12:15:41 +01:00
Sami Kerola
3489b9343e pkill: fix error printing
Print correct pid number of process that was where not killed
because of kill was not successful. Incorrect behaviour before
this fix is bello.

-- snip
$ ps -elf | grep dh[c]
1 S root      1409     1  0  80   0 -  1782 poll_s 02:01 ?        00:00:00 dhclient wlan0
$ pkill dhc
pkill: killing pid 1 failed: Operation not permitted
-- snip

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-21 12:15:40 +01:00
Sami Kerola
79ceb30b5c ps: unify cases and remove trailing dots in messages
Strings with lower caps & no trailing dots have greater change to
have multiple occurences, meaning less effort for translators, than
strings with them.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-15 20:52:58 +01:00
Sami Kerola
0e8c4659de other: make AUTHORS file obsolete
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-13 22:42:38 +01:00
Sami Kerola
5c9ec043cd docs: remove old information from HACKING
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-13 22:42:38 +01:00
Sami Kerola
809906b6a7 ps: add catastrophic_failure()
The catastrophic_failure function tries to make bug reporting useful
by telling in which line error occured, and drops core.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-13 22:42:38 +01:00
Sami Kerola
bf88c882ed other: tell in ChangeLog where to see changes
We do not want to maintain ChangeLog, people should look git log
instead.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-13 22:42:38 +01:00
Jim Warner
b73a423cc2 top: avoid %cpu distortions when toggling task/thread modes
This commit addresses a long standing buglet (debian #441166) which
surfaces when the display mode is switched between task and threads.

An extra procps refresh is now forced upon such a transition which
parallels the approach used at startup for the exact same reason.

Reference: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=441166
2012-01-14 00:04:46 +11:00
Jim Warner
b246af9cec top: force newline for unexpected signal abnormal exit
This commit just restores the pre-nls behavior, which was lost
in the migration to nls string tables support.
2012-01-14 00:04:46 +11:00
Jim Warner
3ad8fd56ed vmstat: slabinfo (-m option) test disabled if not readable
The dejagnu tests for slabtop are skipped when "/proc/slabinfo" is
unreadable due to permissions.  This commit provides the same check
for vmstat under its -m (slabinfo) option.
2012-01-14 00:04:46 +11:00
Craig Small
58a6c89cd1 sysctl -p has no space
The man page has examples like sysctl -p filename. Optional arguments
using getopt cannot have a space between the option and argument.
So the correct format is sysctl -pfilename
2012-01-13 23:59:26 +11:00
Craig Small
3c2377ca15 Linux version for non-linux systems
On non-linux systems, uts.version provides the version of that
specific kernel (FreeBSD or Hurd version, for example) and not the
emulated procfs pseudo version.

On those systems we need to directly read /proc/version and parse the
string.  This change replaces Debian patches gnu-kbsd-version and
complain_unmounted_proc patches.
2012-01-09 21:57:44 +11:00
Craig Small
a909f6e917 Change restrict to __restrict in public includes
procps automake defines restrict which means the binaries for procps
binaries compile. However external programs may not of defined
restrict which means they will not complie if they include files found
in /usr/include/proc.

Includes from libc6 use __restrict and if is good enough for
them, its good enough for us.
2012-01-09 21:44:51 +11:00
Craig Small
1928653399 watch needs a conditonal LDADD
Makes Debian patch makefile_watch_ncurses redundant.
watch was being linked to NCURSES_LIBS when it should of been
WATCH_NCURSES_LIBS which can be ncursesw with 8bit enabled.
2012-01-09 21:40:53 +11:00
Sami Kerola
cac93d35d0 build-sys: use dist-xz
Even as conservative project as coreutils has switched to xz distributions so
neither should we have any reason to use gz and waste space & bandwidth.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-08 23:02:17 +01:00
Sami Kerola
6c21a3613b other: indent FAQ file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-08 21:57:35 +01:00
Sami Kerola
feb25fc10e other: update CodingStyle
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-08 21:57:34 +01:00
Sami Kerola
5aabf74e73 other: update BUGS file
Change information submission address to be procps@freelists.org and
instruct people to send patches in 'git am' friendly format.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-08 21:57:34 +01:00
Sami Kerola
b29a64be17 other: update TODO
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-08 21:57:34 +01:00
Sami Kerola
be0dfba9b2 other: move files to Documentation/ directory
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-08 21:57:26 +01:00
Sami Kerola
794298b9f9 build-sys: use git version as package version
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-08 21:35:07 +01:00
Sami Kerola
6241e9d545 w: indicate unknown host when -f is used
The option -f used too print `-' to FROM column when host was not
known. This commit changes behaviour back to what it was earlier.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-08 21:31:56 +01:00
Sami Kerola
9d47cb0c38 pwdx: re-create invalid process id check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-08 21:29:51 +01:00
Craig Small
ab25578bee Updated NEWS with new items for procps-ng 3.3.2 2012-01-06 16:48:09 +11:00
Sami Kerola
b0d0b4856e docs: add preload paths to sysctl.conf.5
The patch also has other maintenance fixes, such as man header fixes,
high lighting corrections and add bug report address.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-06 16:12:22 +11:00
Sami Kerola
ec1f4d394a docs: clarify slabtop sort criteria listing
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-06 16:10:10 +11:00
Sami Kerola
bb142f7aa6 slabtop: total slabs & caches header fix
Commit 0ac63f5bc1 messed up header
print order; the Total Slabs and Total Caches where reported in place
of each other.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-01-06 16:10:09 +11:00