From cb5f147a168da00bf50956ef37cb73e504b78a9d Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mon, 11 May 2009 14:33:44 -0400 Subject: [PATCH] Fix warnings in monitor.c and confdb.c --- server/confdb/confdb.c | 2 +- server/monitor/monitor.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/server/confdb/confdb.c b/server/confdb/confdb.c index cfa4289..0bafc49 100644 --- a/server/confdb/confdb.c +++ b/server/confdb/confdb.c @@ -112,7 +112,7 @@ done: * the separator is a string, and is case-sensitive. * optionally single values can be trimmed of of spaces and tabs */ static int split_on_separator(TALLOC_CTX *mem_ctx, const char *str, - char *sep, bool trim, char ***_list, int *size) + const char *sep, bool trim, char ***_list, int *size) { const char *t, *p, *n; size_t l, s, len; diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c index 55c6c08..75b0039 100644 --- a/server/monitor/monitor.c +++ b/server/monitor/monitor.c @@ -123,7 +123,7 @@ static int add_new_provider(struct mt_ctx *ctx, const char *name); static int monitor_signal_reconf(struct confdb_ctx *cdb, void *pvt); static int update_monitor_config(struct mt_ctx *ctx); -static int monitor_cleanup(); +static int monitor_cleanup(void); /* dbus_get_monitor_version * Return the monitor version over D-BUS */ @@ -997,7 +997,7 @@ static int monitor_cleanup(void) TALLOC_CTX *tmp_ctx; tmp_ctx = talloc_new(NULL); - if (!tmp_ctx) return; + if (!tmp_ctx) return ENOMEM; file = talloc_asprintf(tmp_ctx, "%s/%s.pid", PID_PATH, "sssd"); if (file == NULL) { @@ -1025,8 +1025,6 @@ static void monitor_quit(struct tevent_context *ev, void *siginfo, void *private_data) { - struct mt_ctx *ctx = talloc_get_type(private_data, struct mt_ctx); - monitor_cleanup(); #if HAVE_GETPGRP @@ -1952,7 +1950,8 @@ int main(int argc, const char *argv[]) if (opt_daemon) flags |= FLAGS_DAEMON; if (opt_interactive) flags |= FLAGS_INTERACTIVE; - if (!opt_config_file) opt_config_file = CONFDB_DEFAULT_CONFIG_FILE; + if (!opt_config_file) + opt_config_file = talloc_strdup(NULL, CONFDB_DEFAULT_CONFIG_FILE); /* we want a pid file check */ flags |= FLAGS_PID_FILE; -- 1.6.2.2