snice: Fix matching on PID
@MarsChan correctly pointed out that the read() always returns 128 bytes, so skipping on >= 128 will always mean we skip. Their suggestion was to remove the equality, but read will never go past 128 bytes so I just removed that part of the check. References: procps-ng/procps!89
This commit is contained in:
4
skill.c
4
skill.c
@ -200,9 +200,9 @@ static void check_proc(int pid, struct run_time_conf_t *run_time)
|
||||
goto closure;
|
||||
}
|
||||
len = read(fd, buf, sizeof(buf));
|
||||
if (len <= 0 || (size_t)len >= sizeof(buf))
|
||||
if (len <= 0)
|
||||
goto closure;
|
||||
buf[len] = '\0';
|
||||
buf[sizeof(buf) -1] = '\0';
|
||||
tmp = strrchr(buf, ')');
|
||||
if (!tmp)
|
||||
goto closure;
|
||||
|
Reference in New Issue
Block a user