{ pid_t pid; va_list ap; char* cmd_ = NULL; va_start(ap, cmd); vasprintf(&cmd_, cmd, ap); char *argv[] = {"sh", "-c", cmd_, NULL}; int status; lprintf("Run command: %s", cmd_); status = posix_spawn(&pid, "/bin/sh", NULL, NULL, argv, environ); if (status...
{ pid_t pid; va_list ap; char* cmd_ = NULL; va_start(ap, cmd); vasprintf(&cmd_, cmd, ap); char *argv[] = {"sh", "-c", cmd_, NULL}; int status; lprintf("Run command: %s", cmd_); status = posix_spawn(&pid, "/bin/sh", NULL, NULL, argv, environ); if (status...