summaryrefslogtreecommitdiffstats
path: root/src/monitor
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2014-10-23 10:55:08 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-10-31 18:05:49 +0100
commitcff89439b21f8573c6896b09cb1a8d5f9de3144c (patch)
treed25e7ebaa35f0a1bf1b7a95bac296ea020c77758 /src/monitor
parent3256bd11e64c12c10ccac7192063e60ec68a2ad9 (diff)
downloadsssd-cff89439b21f8573c6896b09cb1a8d5f9de3144c.tar.gz
sssd-cff89439b21f8573c6896b09cb1a8d5f9de3144c.tar.xz
sssd-cff89439b21f8573c6896b09cb1a8d5f9de3144c.zip
MONITOR: Fix warning may be used uninitialized
This warning is caused be change 579e5d4b7a3ca161ea7518b2996905fa22c15995 "MONITOR: Allow confdb to be accessed by nonroot user" src/monitor/monitor.c: In function ‘main’: src/monitor/monitor.c:2953:24: error: ‘monitor’ may be used uninitialized in this function [-Werror=maybe-uninitialized] monitor->is_daemon = !opt_interactive; ^ cc1: all warnings being treated as errors Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/monitor')
-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));