CXX_BUILD fixes

This commit is contained in:
twinaphex 2016-04-27 11:11:53 +02:00
parent d4a50935d2
commit 6cc60a2d02
2 changed files with 30 additions and 15 deletions

View File

@ -797,14 +797,16 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
if (!current_audio || !current_audio->device_list_free
|| !audio_driver_context_audio_data)
return false;
current_audio->device_list_free(audio_driver_context_audio_data, audio_driver_devices_list);
current_audio->device_list_free(audio_driver_context_audio_data,
audio_driver_devices_list);
audio_driver_devices_list = NULL;
break;
case RARCH_AUDIO_CTL_DEVICES_LIST_NEW:
if (!current_audio || !current_audio->device_list_new
|| !audio_driver_context_audio_data)
return false;
audio_driver_devices_list = current_audio->device_list_new(audio_driver_context_audio_data);
audio_driver_devices_list = (struct string_list*)
current_audio->device_list_new(audio_driver_context_audio_data);
if (!audio_driver_devices_list)
return false;
break;

View File

@ -3076,9 +3076,12 @@ static void overlay_enable_toggle_change_handler(void *data)
static void systemd_service_toggle(const char *path, char *unit, bool enable)
{
int pid = fork();
char* args[] = {"systemctl", NULL, NULL, NULL};
char* args[] = {(char*)"systemctl", NULL, NULL, NULL};
args[1] = enable ? "start" : "stop";
if (enable)
args[1] = (char*)"start";
else
args[1] = (char*)"stop";
args[2] = unit;
if (enable)
@ -3086,33 +3089,43 @@ static void systemd_service_toggle(const char *path, char *unit, bool enable)
else
remove(path);
if (pid == 0) {
if (pid == 0)
execvp(args[0], args);
}
return;
}
static void ssh_enable_toggle_change_handler(void *data)
{
bool enable = false;
settings_t *settings = config_get_ptr();
systemd_service_toggle(LAKKA_SSH_PATH, "sshd.service",
settings && settings->ssh_enable);
return;
if (settings && settings->ssh_enable)
enable = true;
systemd_service_toggle(LAKKA_SSH_PATH, (char*)"sshd.service",
enable);
}
static void samba_enable_toggle_change_handler(void *data)
{
bool enable = false;
settings_t *settings = config_get_ptr();
systemd_service_toggle(LAKKA_SAMBA_PATH, "smbd.service",
settings && settings->samba_enable);
return;
if (settings && settings->ssh_enable)
enable = true;
systemd_service_toggle(LAKKA_SAMBA_PATH, (char*)"smbd.service",
enable);
}
static void bluetooth_enable_toggle_change_handler(void *data)
{
bool enable = false;
settings_t *settings = config_get_ptr();
systemd_service_toggle(LAKKA_BLUETOOTH_PATH, "bluetooth.service",
settings && settings->bluetooth_enable);
return;
if (settings && settings->ssh_enable)
enable = true;
systemd_service_toggle(LAKKA_BLUETOOTH_PATH, (char*)"bluetooth.service",
enable);
}
#endif