mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-19 09:17:38 +03:00
SpiceAgent: Exit early if SPICE_DEVICE
doesn't exist
This commit is contained in:
parent
13506a612e
commit
4be5000c22
Notes:
sideshowbarker
2024-07-17 00:59:43 +09:00
Author: https://github.com/caoimhebyrne Commit: https://github.com/SerenityOS/serenity/commit/4be5000c22 Pull-request: https://github.com/SerenityOS/serenity/pull/19234 Reviewed-by: https://github.com/LucasChollet
@ -10,6 +10,7 @@
|
||||
#include <LibCore/StandardPaths.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibDesktop/Launcher.h>
|
||||
#include <LibFileSystem/FileSystem.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Clipboard.h>
|
||||
#include <LibIPC/ConnectionToServer.h>
|
||||
@ -20,6 +21,10 @@ static constexpr auto SPICE_DEVICE = "/dev/hvc0p1"sv;
|
||||
|
||||
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
{
|
||||
if (!FileSystem::exists(SPICE_DEVICE)) {
|
||||
return Error::from_string_literal("Failed to find spice device file!");
|
||||
}
|
||||
|
||||
// We use the application to be able to easily write to the user's clipboard.
|
||||
auto app = TRY(GUI::Application::create(arguments));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user