* [PATCH 0/2] 2 minor misc fixes
@ 2015-06-16 14:26 Ruediger Meier
2015-06-16 14:26 ` [PATCH 1/2] procutils: reset errno before readdir Ruediger Meier
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Ruediger Meier @ 2015-06-16 14:26 UTC (permalink / raw)
To: util-linux
From: Ruediger Meier <ruediger.meier@ga-group.nl>
This is pull request 202 on github
https://github.com/karelzak/util-linux/pull/202
Ruediger Meier (2):
procutils: reset errno before readdir
tests: always kill helper
lib/procutils.c | 1 +
tests/ts/kill/print_pid | 14 +++++++-------
2 files changed, 8 insertions(+), 7 deletions(-)
--
1.8.4.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] procutils: reset errno before readdir
2015-06-16 14:26 [PATCH 0/2] 2 minor misc fixes Ruediger Meier
@ 2015-06-16 14:26 ` Ruediger Meier
2015-06-16 14:26 ` [PATCH 2/2] tests: always kill helper Ruediger Meier
2015-06-17 9:01 ` [PATCH 0/2] 2 minor misc fixes Karel Zak
2 siblings, 0 replies; 4+ messages in thread
From: Ruediger Meier @ 2015-06-16 14:26 UTC (permalink / raw)
To: util-linux
From: Ruediger Meier <ruediger.meier@ga-group.nl>
readdir(3p): "When the end of the directory is encountered, a null
pointer shall be returned and errno is not changed"
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
lib/procutils.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/procutils.c b/lib/procutils.c
index ef96941..1823d16 100644
--- a/lib/procutils.c
+++ b/lib/procutils.c
@@ -143,6 +143,7 @@ int proc_next_pid(struct proc_processes *ps, pid_t *pid)
do {
char buf[BUFSIZ], *p;
+ errno = 0;
d = readdir(ps->dir);
if (!d)
return errno ? -1 : 1; /* error or end-of-dir */
--
1.8.4.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] tests: always kill helper
2015-06-16 14:26 [PATCH 0/2] 2 minor misc fixes Ruediger Meier
2015-06-16 14:26 ` [PATCH 1/2] procutils: reset errno before readdir Ruediger Meier
@ 2015-06-16 14:26 ` Ruediger Meier
2015-06-17 9:01 ` [PATCH 0/2] 2 minor misc fixes Karel Zak
2 siblings, 0 replies; 4+ messages in thread
From: Ruediger Meier @ 2015-06-16 14:26 UTC (permalink / raw)
To: util-linux
From: Ruediger Meier <ruediger.meier@ga-group.nl>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
tests/ts/kill/print_pid | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/ts/kill/print_pid b/tests/ts/kill/print_pid
index 1b3052b..c6187f1 100755
--- a/tests/ts/kill/print_pid
+++ b/tests/ts/kill/print_pid
@@ -41,13 +41,13 @@ fi
if [ "x$TEST_PID" != "x$KILL_PID" ]; then
echo "jobs -p $TEST_PID != kill -p $KILL_PID" >> "$TS_OUTPUT"
all_ok=false
-else
- "$TS_CMD_KILL" -1 $TEST_PID
- wait $TEST_PID
- if [ $? -ne 1 ]; then
- echo "wait $TEST_PID returned ${?}" >> "$TS_OUTPUT"
- all_ok=false
- fi
+fi
+
+"$TS_CMD_KILL" -1 $TEST_PID
+wait $TEST_PID
+if [ $? -ne 1 ]; then
+ echo "wait $TEST_PID returned ${?}" >> "$TS_OUTPUT"
+ all_ok=false
fi
if $all_ok; then
--
1.8.4.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] 2 minor misc fixes
2015-06-16 14:26 [PATCH 0/2] 2 minor misc fixes Ruediger Meier
2015-06-16 14:26 ` [PATCH 1/2] procutils: reset errno before readdir Ruediger Meier
2015-06-16 14:26 ` [PATCH 2/2] tests: always kill helper Ruediger Meier
@ 2015-06-17 9:01 ` Karel Zak
2 siblings, 0 replies; 4+ messages in thread
From: Karel Zak @ 2015-06-17 9:01 UTC (permalink / raw)
To: Ruediger Meier; +Cc: util-linux
On Tue, Jun 16, 2015 at 04:26:55PM +0200, Ruediger Meier wrote:
> Ruediger Meier (2):
> procutils: reset errno before readdir
> tests: always kill helper
Applied, thanks.
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-06-17 9:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-16 14:26 [PATCH 0/2] 2 minor misc fixes Ruediger Meier
2015-06-16 14:26 ` [PATCH 1/2] procutils: reset errno before readdir Ruediger Meier
2015-06-16 14:26 ` [PATCH 2/2] tests: always kill helper Ruediger Meier
2015-06-17 9:01 ` [PATCH 0/2] 2 minor misc fixes Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox