PCP: do not set exe to empty string

In case the executable is an empty string, e.g. if pcp is run by an
unprivileged user, do not set procExe to an empty value, which breaks
the formatting of the PROCEXE column and the merged-cmdline logic.
This commit is contained in:
Christian Göttsche 2021-09-02 23:37:53 +02:00
parent f94934472f
commit 25c945e2ef
1 changed files with 1 additions and 1 deletions

View File

@ -317,7 +317,7 @@ static void PCPProcessList_updateCmdline(Process* process, int pid, int offset,
Process_updateComm(process, comm); Process_updateComm(process, comm);
if (PCPMetric_instance(PCP_PROC_EXE, pid, offset, &value, PM_TYPE_STRING)) { if (PCPMetric_instance(PCP_PROC_EXE, pid, offset, &value, PM_TYPE_STRING)) {
Process_updateExe(process, value.cp); Process_updateExe(process, value.cp[0] ? value.cp : NULL);
free(value.cp); free(value.cp);
} }
} }