summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/pid.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/pid.c b/src/lib/pid.c
index c4235ede3..04bc8d132 100644
--- a/src/lib/pid.c
+++ b/src/lib/pid.c
@@ -329,10 +329,9 @@ void pid_read(pid_t mon_pid) {
329 } 329 }
330 } 330 }
331 331
332 pid_t child = -1;
333 struct dirent *entry; 332 struct dirent *entry;
334 char *end; 333 char *end;
335 while (child < 0 && (entry = readdir(dir))) { 334 while ((entry = readdir(dir))) {
336 pid_t pid = strtol(entry->d_name, &end, 10); 335 pid_t pid = strtol(entry->d_name, &end, 10);
337 pid %= max_pids; 336 pid %= max_pids;
338 if (end == entry->d_name || *end) 337 if (end == entry->d_name || *end)