bugfix for shell cmd executors
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
@ -369,20 +369,21 @@ ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_
|
||||
return actionReboot(data, size);
|
||||
}
|
||||
case (EXECUTE_SHELL_CMD_BLOCKING): {
|
||||
std::string cmd = std::string(cmd, size);
|
||||
int result = std::system(cmd.c_str());
|
||||
std::string cmdToExecute = std::string(reinterpret_cast<const char*>(data), size);
|
||||
int result = std::system(cmdToExecute.c_str());
|
||||
if (result != 0) {
|
||||
// TODO: Data reply with returnalue maybe?
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
return EXECUTION_FINISHED;
|
||||
}
|
||||
case (EXECUTE_SHELL_CMD_NON_BLOCKING): {
|
||||
std::string cmd = std::string(cmd, size);
|
||||
std::string cmdToExecute = std::string(reinterpret_cast<const char*>(data), size);
|
||||
if (cmdExecutor.getCurrentState() == CommandExecutor::States::PENDING or
|
||||
shellCmdIsExecuting) {
|
||||
return HasActionsIF::IS_BUSY;
|
||||
}
|
||||
cmdExecutor.load(cmd, false, false);
|
||||
cmdExecutor.load(cmdToExecute, false, false);
|
||||
ReturnValue_t result = cmdExecutor.execute();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user