summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/monitor/monitor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index 0dea32721..b55757d95 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -1723,7 +1723,9 @@ static errno_t load_configuration(TALLOC_CTX *mem_ctx,
* when SSSD runs as nonroot */
ret = chown(cdb_file, ctx->uid, ctx->gid);
if (ret != 0) {
- ret = errno;
+ /* Init ret to suppress gcc warning with high -O level */
+ ret = EINVAL;
+ if (errno) ret = errno;
DEBUG(SSSDBG_FATAL_FAILURE,
"chown failed for [%s]: [%d][%s].\n",
cdb_file, ret, sss_strerror(ret));