From f085ae400c60289f61d99e9e80ce037beedf38b4 Mon Sep 17 00:00:00 2001 From: Doug Freed Date: Tue, 24 Mar 2015 19:28:47 +0000 Subject: Fix some compiler warnings librc: Fix C90 warning (mixed declaration and code) rc: Fix warning about discarding const qualifier Fixes #45. --- src/librc/librc-daemon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/librc') diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c index 76fdd7b1..3811a043 100644 --- a/src/librc/librc-daemon.c +++ b/src/librc/librc-daemon.c @@ -510,6 +510,8 @@ rc_service_daemons_crashed(const char *service) RC_STRINGLIST *list = NULL; RC_STRING *s; size_t i; + char *ch_root; + char *spidfile; path += snprintf(dirpath, sizeof(dirpath), RC_SVCDIR "/daemons/%s", basename_c(service)); @@ -554,8 +556,8 @@ rc_service_daemons_crashed(const char *service) } fclose(fp); - char *ch_root = rc_service_value_get(basename_c(service), "chroot"); - char *spidfile = pidfile; + ch_root = rc_service_value_get(basename_c(service), "chroot"); + spidfile = pidfile; if (ch_root && pidfile) { spidfile = xmalloc(strlen(ch_root) + strlen(pidfile) + 1); strcpy(spidfile, ch_root); -- cgit v1.2.3