|
@@ -443,6 +443,7 @@ void init_menu_system_values(){
|
|
|
volume_percentage = 50; ///wrong value: setting default to 50
|
|
|
}
|
|
|
else{
|
|
|
+ pclose(fp);
|
|
|
fgets(res, sizeof(res)-1, fp);
|
|
|
|
|
|
/// Check if Volume is a number (at least the first char)
|
|
@@ -463,6 +464,7 @@ void init_menu_system_values(){
|
|
|
brightness_percentage = 50; ///wrong value: setting default to 50
|
|
|
}
|
|
|
else{
|
|
|
+ pclose(fp);
|
|
|
fgets(res, sizeof(res)-1, fp);
|
|
|
|
|
|
/// Check if brightness is a number (at least the first char)
|
|
@@ -707,7 +709,10 @@ void run_menu_loop()
|
|
|
RES_HW_SCREEN_HORIZONTAL * RES_HW_SCREEN_VERTICAL * sizeof(uint16_t));
|
|
|
|
|
|
/* Stop Ampli */
|
|
|
- popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
|
|
|
+ fp = popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
|
|
|
+ if (fp != NULL) {
|
|
|
+ pclose(fp);
|
|
|
+ }
|
|
|
|
|
|
/// ------ Wait for menu UP key event ------
|
|
|
int actions[IN_BINDTYPE_COUNT] = { 0, };
|
|
@@ -800,7 +805,9 @@ void run_menu_loop()
|
|
|
fp = popen(shell_cmd, "r");
|
|
|
if (fp == NULL) {
|
|
|
MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ pclose(fp);
|
|
|
+ }
|
|
|
|
|
|
/// ------ Refresh screen ------
|
|
|
screen_refresh = 1;
|
|
@@ -816,6 +823,8 @@ void run_menu_loop()
|
|
|
fp = popen(shell_cmd, "r");
|
|
|
if (fp == NULL) {
|
|
|
MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
|
|
|
+ } else {
|
|
|
+ pclose(fp);
|
|
|
}
|
|
|
/// ------ Refresh screen ------
|
|
|
screen_refresh = 1;
|
|
@@ -872,6 +881,8 @@ void run_menu_loop()
|
|
|
fp = popen(shell_cmd, "r");
|
|
|
if (fp == NULL) {
|
|
|
MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
|
|
|
+ } else {
|
|
|
+ pclose(fp);
|
|
|
}
|
|
|
/// ------ Refresh screen ------
|
|
|
screen_refresh = 1;
|
|
@@ -887,6 +898,8 @@ void run_menu_loop()
|
|
|
fp = popen(shell_cmd, "r");
|
|
|
if (fp == NULL) {
|
|
|
MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
|
|
|
+ } else {
|
|
|
+ pclose(fp);
|
|
|
}
|
|
|
/// ------ Refresh screen ------
|
|
|
screen_refresh = 1;
|
|
@@ -953,6 +966,8 @@ void run_menu_loop()
|
|
|
fp = popen(shell_cmd, "r");
|
|
|
if (fp == NULL) {
|
|
|
MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
|
|
|
+ } else {
|
|
|
+ pclose(fp);
|
|
|
}
|
|
|
|
|
|
stop_menu_loop = 1;
|
|
@@ -998,6 +1013,8 @@ void run_menu_loop()
|
|
|
fp = popen(shell_cmd, "r");
|
|
|
if (fp == NULL) {
|
|
|
MENU_ERROR_PRINTF("Failed to run command %s\n", shell_cmd);
|
|
|
+ } else {
|
|
|
+ pclose(fp);
|
|
|
}
|
|
|
|
|
|
/*snprintf(hud_msg, sizeof(hud_msg), ret == 0 ? "LOADED" : "FAIL!");
|
|
@@ -1095,7 +1112,10 @@ void run_menu_loop()
|
|
|
}
|
|
|
|
|
|
/* Start Ampli */
|
|
|
- popen(SHELL_CMD_TURN_AMPLI_ON, "r");
|
|
|
+ fp = popen(SHELL_CMD_TURN_AMPLI_ON, "r");
|
|
|
+ if (fp != NULL) {
|
|
|
+ pclose(fp);
|
|
|
+ }
|
|
|
|
|
|
/// ------ Reset last screen ------
|
|
|
SDL_BlitSurface(backup_hw_screen, NULL, hw_screen, NULL);
|
|
@@ -1125,9 +1145,13 @@ int launch_resume_menu_loop()
|
|
|
uint8_t screen_refresh = 1;
|
|
|
uint8_t menu_confirmation = 0;
|
|
|
int option_idx=RESUME_YES;
|
|
|
+ FILE *fp;
|
|
|
|
|
|
/* Stop Ampli */
|
|
|
- popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
|
|
|
+ fp = popen(SHELL_CMD_TURN_AMPLI_OFF, "r");
|
|
|
+ if (fp != NULL) {
|
|
|
+ pclose(fp);
|
|
|
+ }
|
|
|
|
|
|
/* Save prev key repeat params and set new Key repeat */
|
|
|
SDL_GetKeyRepeat(&backup_key_repeat_delay, &backup_key_repeat_interval);
|
|
@@ -1296,7 +1320,10 @@ int launch_resume_menu_loop()
|
|
|
}
|
|
|
|
|
|
/* Start Ampli */
|
|
|
- popen(SHELL_CMD_TURN_AMPLI_ON, "r");
|
|
|
+ fp = popen(SHELL_CMD_TURN_AMPLI_ON, "r");
|
|
|
+ if (fp != NULL) {
|
|
|
+ pclose(fp);
|
|
|
+ }
|
|
|
|
|
|
return option_idx;
|
|
|
}
|