execute command inside server fixed (from fix simulator tests and exec command PR) (#856)

This commit is contained in:
2023-11-08 09:26:00 +01:00
committed by GitHub
parent 573177203b
commit beafe86554
10 changed files with 11 additions and 10 deletions

View File

@ -17,7 +17,7 @@ const char *getRetName();
void function_table();
void functionNotImplemented();
void modeNotImplemented(char *modename, int mode);
void executeCommand(char *command, char *result, enum TLogLevel level);
int executeCommand(char *command, char *result, enum TLogLevel level);
int M_nofunc(int);
#if defined(MYTHEN3D) || defined(GOTTHARD2D)
void rebootNiosControllerAndFPGA();

View File

@ -516,7 +516,7 @@ void modeNotImplemented(char *modename, int mode) {
LOG(logERROR, (mess));
}
void executeCommand(char *command, char *result, enum TLogLevel level) {
int executeCommand(char *command, char *result, enum TLogLevel level) {
ret = OK;
memset(mess, 0, sizeof(mess));
@ -535,7 +535,7 @@ void executeCommand(char *command, char *result, enum TLogLevel level) {
if (sysFile == NULL) {
ret = FAIL;
sprintf(mess, "Executing cmd[%s] failed\n", cmd);
return;
return ret;
}
while (fgets(temp, tempsize, sysFile) != NULL) {
// size left excludes terminating character
@ -560,6 +560,7 @@ void executeCommand(char *command, char *result, enum TLogLevel level) {
} else {
LOG(level, ("Result:\n[%s]\n", result));
}
return ret;
}
int M_nofunc(int file_des) {