From: Ruediger Meier <ruediger.meier@xxxxxxxxxxx> 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@xxxxxxxxxxx> --- 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 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html