Disable sleep mode during data operations.

This commit is contained in:
Steven Smith 2016-05-08 12:47:08 -07:00
parent 585bc28963
commit 94f2a6a8aa
3 changed files with 19 additions and 0 deletions

View File

@ -644,6 +644,10 @@ void error_display_errno(volatile bool* dismissed, void* data, void (*drawTop)(u
vsnprintf(textBuf, 1024, text, list);
va_end(list);
if(err < 0) {
err = -err;
}
snprintf(errorData->fullText, 4096, "%s\nI/O Error: %s (%d)", textBuf, strerror(err), err);
prompt_display("Error", errorData->fullText, COLOR_TEXT, false, errorData, NULL, error_draw_top, error_onresponse);

View File

@ -305,7 +305,18 @@ static void networkinstall_wait_update(ui_view* view, void* data, float* progres
networkInstallData->clientSocket = sock;
prompt_display("Confirmation", "Install the received file(s)?", COLOR_TEXT, true, data, NULL, NULL, networkinstall_confirm_onresponse);
} else if(errno != EAGAIN) {
if(errno == 22 || errno == 115) {
ui_pop();
info_destroy(view);
}
error_display_errno(NULL, NULL, NULL, errno, "Failed to open socket.");
if(errno == 22 || errno == 115) {
networkinstall_free_data(networkInstallData);
return;
}
}
struct in_addr addr = {(in_addr_t) gethostid()};

View File

@ -130,6 +130,8 @@ static void task_data_op_thread(void* arg) {
svcCloseHandle(data->cancelEvent);
data->finished = true;
aptSetSleepAllowed(true);
}
Result task_data_op(data_op_data* data) {
@ -162,5 +164,7 @@ Result task_data_op(data_op_data* data) {
}
}
aptSetSleepAllowed(false);
return res;
}