aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Freed <dwfreed@mtu.edu>2015-03-24 19:28:47 +0000
committerWilliam Hubbs <w.d.hubbs@gmail.com>2015-03-24 19:08:29 -0500
commitf085ae400c60289f61d99e9e80ce037beedf38b4 (patch)
treed3f0e1ab3a88bac130b06d2ad1f854bfe6abac23
parentc1faafcad8197a821282b8e56a10132e27eb5d9f (diff)
Fix some compiler warnings
librc: Fix C90 warning (mixed declaration and code) rc: Fix warning about discarding const qualifier Fixes #45.
-rw-r--r--src/librc/librc-daemon.c6
-rw-r--r--src/rc/rc.c2
2 files changed, 5 insertions, 3 deletions
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);
diff --git a/src/rc/rc.c b/src/rc/rc.c
index e3301c6c..dd35482f 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -519,7 +519,7 @@ runlevel_config(const char *service, const char *level)
}
static void
-do_stop_services(const RC_STRINGLIST *types_n, const RC_STRINGLIST *start_services,
+do_stop_services(RC_STRINGLIST *types_n, RC_STRINGLIST *start_services,
const RC_STRINGLIST *stop_services, const RC_DEPTREE *deptree,
const char *newlevel, bool parallel, bool going_down)
{