summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-creds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-bus/bus-creds.c')
-rw-r--r--src/libsystemd-bus/bus-creds.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd-bus/bus-creds.c b/src/libsystemd-bus/bus-creds.c
index 22f204fd93..ea7b1ce1f9 100644
--- a/src/libsystemd-bus/bus-creds.c
+++ b/src/libsystemd-bus/bus-creds.c
@@ -607,10 +607,10 @@ int bus_creds_add_more(sd_bus_creds *c, uint64_t mask, pid_t pid, pid_t tid) {
if (missing & SD_BUS_CREDS_COMM) {
r = get_process_comm(pid, &c->comm);
- if (r < 0)
+ if (r < 0 && r != -ESRCH)
return r;
-
- c->mask |= SD_BUS_CREDS_COMM;
+ else if (r >= 0)
+ c->mask |= SD_BUS_CREDS_COMM;
}
if (missing & SD_BUS_CREDS_EXE) {