From: Daniel Walton Date: Tue, 21 Jun 2016 14:24:29 +0000 (+0000) Subject: Fix build warnings in start-stop-daemon.c X-Git-Tag: frr-2.0-rc1~515 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c9deb8fd4512802f4e1ad86b5ed32217358d7ea8;p=mirror%2Ffrr.git Fix build warnings in start-stop-daemon.c Signed-off-by: Daniel Walton Reviewed-by: Donald Sharp Ticket: CM-11484 (cherry picked from commit 39dcf9acd87b18ab00f9f71ec15fdd89fff4b3c8) --- diff --git a/cumulus/start-stop-daemon.c b/cumulus/start-stop-daemon.c index e317bb801c..ea63fbc217 100644 --- a/cumulus/start-stop-daemon.c +++ b/cumulus/start-stop-daemon.c @@ -107,7 +107,7 @@ LIST_HEAD(namespace_head, namespace); struct namespace { LIST_ENTRY(namespace) list; - char *path; + const char *path; int nstype; }; @@ -222,12 +222,12 @@ clear(struct pid_list **list) *list = NULL; } -static char * +static const char * next_dirname(const char *s) { - char *cur; + const char *cur; - cur = (char *)s; + cur = (const char *)s; if (*cur != '\0') { for (; *cur != '/'; ++cur) @@ -248,7 +248,7 @@ add_namespace(const char *path) const char *nsdirname, *nsname, *cur; struct namespace *namespace; - cur = (char *)path; + cur = (const char *)path; nsdirname = nsname = ""; while ((cur = next_dirname(cur))[0] != '\0') { @@ -266,7 +266,7 @@ add_namespace(const char *path) badusage("invalid namepspace path"); namespace = xmalloc(sizeof(*namespace)); - namespace->path = (char *)path; + namespace->path = (const char *)path; namespace->nstype = nstype; LIST_INSERT_HEAD(&namespace_head, namespace, list); }