From 5a4c61838f6089cebe34d98732435787272fe50d Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Thu, 4 May 2023 21:45:24 -0400 Subject: [PATCH] FileSystemAccessServer: Use `ECANCELED` instead of -1 -1 was used when the user cancel the dialog, `ECANCELED` is a bit more explicit about what it is. --- Userland/Libraries/LibFileSystemAccessClient/Client.cpp | 2 +- .../Services/FileSystemAccessServer/ConnectionFromClient.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibFileSystemAccessClient/Client.cpp b/Userland/Libraries/LibFileSystemAccessClient/Client.cpp index 5f4a039af5..703f7d9f3b 100644 --- a/Userland/Libraries/LibFileSystemAccessClient/Client.cpp +++ b/Userland/Libraries/LibFileSystemAccessClient/Client.cpp @@ -122,7 +122,7 @@ void Client::handle_prompt_end(i32 request_id, i32 error, Optional co if (error != 0) { // We don't want to show an error message for non-existent files since some applications may want // to handle it as opening a new, named file. - if (error != -1 && error != ENOENT) + if (error != ECANCELED && error != ENOENT) GUI::MessageBox::show_error(request_data.parent_window, DeprecatedString::formatted("Opening \"{}\" failed: {}", *chosen_file, strerror(error))); request_data.promise->resolve(Error::from_errno(error)).release_value_but_fixme_should_propagate_errors(); return; diff --git a/Userland/Services/FileSystemAccessServer/ConnectionFromClient.cpp b/Userland/Services/FileSystemAccessServer/ConnectionFromClient.cpp index dfc25edae3..020ea3415e 100644 --- a/Userland/Services/FileSystemAccessServer/ConnectionFromClient.cpp +++ b/Userland/Services/FileSystemAccessServer/ConnectionFromClient.cpp @@ -156,7 +156,7 @@ void ConnectionFromClient::prompt_helper(i32 request_id, Optional {}, Optional {}); + async_handle_prompt_end(request_id, ECANCELED, Optional {}, Optional {}); } }