by also expecting the ".scope" part and trying the next entry if it is
not present instead of immediately failing.
It's still unexpected to encounter such entries, so keep the log line.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
errno = 0;
char *endptr = NULL;
vmid = strtoul(vmid_start, &endptr, 10);
+ if (!endptr || strncmp(endptr, ".scope", 6)) {
+ fprintf(stderr, "unexpected cgroup entry %s\n", buf);
+ vmid = 0;
+ continue;
+ }
if (errno != 0) {
fprintf(stderr, "error parsing vmid for %d: %s\n", pid, strerror(errno));
vmid = 0;
- } else if (*endptr != '.') {
- fprintf(stderr, "unexpected cgroup entry %s\n", buf);
- vmid = 0;
}
goto ret;