Commit Graph

7 Commits

Author SHA1 Message Date
Tobias Stoeckmann
e8430bad00 Fix readlink's do-while-loop
The function pid_link tries to handle programs which contain very
long paths to their executables. If 1024 bytes are not enough to
contain the path, the loop wants to get more and more space until
the path can fit.

The loop's condition does not fit though.

readlink will never return a value higher than its supplied size
limit, which is "path_alloc_size - 1", therefore the loop-check of
"len == path_alloc_size" will always be false: the loop will never
be repeated.

While at it, the if-condition inside the loop's body can be omitted,
because it is always true.
2015-07-11 21:30:31 +02:00
Craig Small
8e7ef322e2 Update help files
Benno Schulenberg suggested some changes to the help messages
to provide some consistency and clarity for both the users and
translators of procps.

The test needed to be updated as the pmap output changed too.

Signed-off-by: Craig Small <csmall@enc.com.au>
2014-02-02 18:13:01 +11:00
Craig Small
8a38cd5eb4 Split help lines to help translators
To assist translators, the help lines are split so that each translation
chunk has one option. This gives bonus of if we add or change an option,
only that option remains untranslated rather than the entire help block.

Reference:
  http://www.freelists.org/post/procps/procpsng-for-Translation-Project,1

Signed-off-by: Craig Small <csmall@enc.com.au>
2013-12-28 09:25:39 +11:00
Jaromir Capik
f76e1676b5 pidof: fixing compiller warnings
Removing unused variable and adding explicit pid_t retype in printf.
2013-11-04 16:26:19 +01:00
Jaromir Capik
f5d15f4718 pidof: support for omitted %PPID and additional separators
This commit introduces support for special %PPID value that
can be passed to the -o option as a substitution for parent
PID. It also allows users to use two additional separators
for omitted PIDs - colon and semicolon.
2013-10-14 15:38:33 +02:00
Jaromir Capik
91939c23dc pidof: minor fixes
Adding forgotten --check-root switch. Removing uneeded headers.
2013-10-10 17:01:48 +02:00
Jaromir Capik
afe862ebe4 pidof: reimplemented from scratch (replacing sysvinit pidof)
As the sysvinit becomes obsolete, some of the bundled tools
need to find a new home. The procps-ng project seems to be
the most suitable project for adopting the pidof tool.
This commit introduces a redesigned version of pidof
that satisfies the LSB requirements.
In corner cases the behaviour might differ from the former
one as the new version doesn't use any stat(2) calls.
2013-10-10 17:01:48 +02:00