#include "launcher.h" #include "debug.h" #include #include #include using namespace std; Launcher::Launcher(vector const& commandLine) : commandLine(commandLine) { } Launcher::Launcher(vector && commandLine) : commandLine(commandLine) { } void Launcher::exec() { vector args; args.reserve(commandLine.size() + 1); for (auto arg : commandLine) { args.push_back(arg.c_str()); } args.push_back(nullptr); execvp(commandLine[0].c_str(), (char* const*)&args[0]); WARNING("Failed to exec '%s': %s\n", commandLine[0].c_str(), strerror(errno)); }