From aaa77c9f7aa4419139a86f397abc4fce8a8e76dd Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Mon, 10 Jul 2023 10:53:01 +0200 Subject: [PATCH] qmeventd: VMID from PID: don't fail immediately when encountering unexpected entry While such entries shuoldn't exist in practice without manually messing around, it's not hard to imagine, and there's still a good chance the actual VMID can still be found. It's still unexpected to encounter such entries so keep the log line. Signed-off-by: Fiona Ebner --- qmeventd/qmeventd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qmeventd/qmeventd.c b/qmeventd/qmeventd.c index 0130103d..76a894cb 100644 --- a/qmeventd/qmeventd.c +++ b/qmeventd/qmeventd.c @@ -105,7 +105,7 @@ get_vmid_from_pid(pid_t pid) char *cgroup_path = strrchr(buf, ':'); if (!cgroup_path) { fprintf(stderr, "unexpected cgroup entry %s\n", buf); - goto ret; + continue; } cgroup_path++; @@ -116,13 +116,13 @@ get_vmid_from_pid(pid_t pid) char *vmid_start = strrchr(buf, '/'); if (!vmid_start) { fprintf(stderr, "unexpected cgroup entry %s\n", buf); - goto ret; + continue; } vmid_start++; if (vmid_start[0] == '-' || vmid_start[0] == '\0') { fprintf(stderr, "invalid vmid in cgroup entry %s\n", buf); - goto ret; + continue; } errno = 0;