From 9120e619240c698c899a9baea203a52c4bdfd565 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 15 Sep 2020 16:22:14 -0400 Subject: [PATCH] Fix: PERROR spam when `tracing` group does not exist MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The session daemon prints a PERROR on launch when the tracing group does not exist. This should not occur when the group simply does not exist as this is not an error. In that case (ESRCH), a DBG statement is sufficient. Signed-off-by: Jérémie Galarneau Change-Id: I3ade29071a8f4e9fe2eb56bf05ff4150b70fd463 --- src/common/utils.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/utils.c b/src/common/utils.c index 7006a2158..2a20e5a8c 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -1274,8 +1274,14 @@ int utils_get_group_id(const char *name, bool warn, gid_t *gid) } } if (ret) { - PERROR("Failed to get group file entry for group name \"%s\"", - name); + if (ret == ESRCH) { + DBG("Could not find group file entry for group name '%s'", + name); + } else { + PERROR("Failed to get group file entry for group name '%s'", + name); + } + ret = -1; goto error; } -- 2.34.1