Skip to content

Commit

Permalink
realtime: Fix parsing status file of host processes
Browse files Browse the repository at this point in the history
If the process is not in a namespace the NSPid property will only
have a single entry.
  • Loading branch information
TingPing committed Nov 12, 2024
1 parent cb02780 commit 6111546
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/xdp-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,11 +736,13 @@ parse_status_field_pid (const char *val,
{
const char *t;

// This is a tab separated list of namespaces. In the case of no namespaces
// there will be one entry.
t = strrchr (val, '\t');
if (t == NULL)
return -ENOENT;
if (t != NULL)
val = t;

return parse_pid (t, pid);
return parse_pid (val, pid);
}

static pid_t
Expand Down

0 comments on commit 6111546

Please sign in to comment.