diff --git a/source/ui/error.c b/source/ui/error.c index a16624a..4343cc9 100644 --- a/source/ui/error.c +++ b/source/ui/error.c @@ -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); diff --git a/source/ui/section/networkinstall.c b/source/ui/section/networkinstall.c index 71d98d2..9456a03 100644 --- a/source/ui/section/networkinstall.c +++ b/source/ui/section/networkinstall.c @@ -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()}; diff --git a/source/ui/section/task/dataop.c b/source/ui/section/task/dataop.c index dbaff43..9566a51 100644 --- a/source/ui/section/task/dataop.c +++ b/source/ui/section/task/dataop.c @@ -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; } \ No newline at end of file