exec_runtask(): Refactor, remove GLIBC:isms to build with musl

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-09-04 20:05:22 +02:00
parent fdd13c1ae1
commit f3a000560f
+4 -4
View File
@@ -224,14 +224,14 @@ int exec_runtask(char *cmd, char *args[])
NULL
};
for (i = 0; args[i]; i++) {
strlcat(buf, cmd, sizeof(buf));
for (i = 1; args[i]; i++) {
strlcat(buf, " ", sizeof(buf));
strlcat(buf, args[i], sizeof(buf));
if (args[i + 1])
strlcat(buf, " ", sizeof(buf));
}
logit(LOG_DEBUG, "Calling %s %s", _PATH_BSHELL, buf);
return execve(_PATH_BSHELL, argv, __environ);
return execvp(_PATH_BSHELL, argv);
}
static void prepare_tty(char *tty, char *procname, int console)