summaryrefslogtreecommitdiffstats
path: root/watchquagga
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-07-26 00:55:47 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-07-26 00:55:47 +0200
commit88177fe3eddaf0bad82e85b87556ace1eefbe361 (patch)
tree9a0fdb5b0aa139350310b19cff1c8dba8f07311d /watchquagga
parentFix bugs reported by coverity scan (diff)
downloadfrr-88177fe3eddaf0bad82e85b87556ace1eefbe361.tar.xz
frr-88177fe3eddaf0bad82e85b87556ace1eefbe361.zip
Fixup of warnings in the code
Ticket: None Reviewed by: Trivial Testing: A bunch of warnings have crept in to the code base. This fixes the issue
Diffstat (limited to 'watchquagga')
-rw-r--r--watchquagga/watchquagga.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/watchquagga/watchquagga.c b/watchquagga/watchquagga.c
index 0b48708b7..1e930f401 100644
--- a/watchquagga/watchquagga.c
+++ b/watchquagga/watchquagga.c
@@ -329,7 +329,7 @@ DEFAULT_PERIOD,DEFAULT_TIMEOUT,DEFAULT_RESTART_TIMEOUT,DEFAULT_PIDFILE);
}
static pid_t
-run_background(const char *shell_cmd)
+run_background(char *shell_cmd)
{
pid_t child;
@@ -345,8 +345,10 @@ run_background(const char *shell_cmd)
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);