]> git.proxmox.com Git - mirror_frr.git/blobdiff - watchquagga/watchquagga.c
Fixup of warnings in the code
[mirror_frr.git] / watchquagga / watchquagga.c
index 0b48708b780ba05dc9c617a63ed02580005b4bb6..1e930f4018daac9b38dd682b74d229af537fc0d7 100644 (file)
@@ -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);