watchquagga.c does not compile without warnings
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/watchquagga/watchquagga.c b/watchquagga/watchquagga.c
index d92803d..9bd7a5f 100644
--- a/watchquagga/watchquagga.c
+++ b/watchquagga/watchquagga.c
@@ -334,7 +334,7 @@
}
static pid_t
-run_background(const char *shell_cmd)
+run_background(char *shell_cmd)
{
pid_t child;
@@ -350,8 +350,10 @@
if (setpgid(0,0) < 0)
zlog_warn("warning: setpgid(0,0) failed: %s",safe_strerror(errno));
{
- const char *argv[4] = { "sh", "-c", shell_cmd, NULL};
- execv("/bin/sh",(char *const *)argv);
+ char shell[] = "sh";
+ char dashc[] = "-c";
+ char *const argv[4] = { shell, dashc, shell_cmd, NULL};
+ execv("/bin/sh", argv);
zlog_err("execv(/bin/sh -c '%s') failed: %s",
shell_cmd,safe_strerror(errno));
_exit(127);