From 4451b4fda0da026ba61dc0816a57c23a09bb57d2 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Mon, 22 Jul 2024 10:16:46 -0400 Subject: [PATCH] LibCore: Log errors from pipe2 when creating an event loop --- .../Libraries/LibCore/EventLoopImplementationUnix.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibCore/EventLoopImplementationUnix.cpp b/Userland/Libraries/LibCore/EventLoopImplementationUnix.cpp index 562d21873d3..2fc0482b7f7 100644 --- a/Userland/Libraries/LibCore/EventLoopImplementationUnix.cpp +++ b/Userland/Libraries/LibCore/EventLoopImplementationUnix.cpp @@ -272,7 +272,13 @@ struct ThreadData { if (wake_pipe_fds[1] != -1) close(wake_pipe_fds[1]); - wake_pipe_fds = MUST(Core::System::pipe2(O_CLOEXEC)); + auto result = Core::System::pipe2(O_CLOEXEC); + if (result.is_error()) { + warnln("\033[31;1mFailed to create event loop pipe:\033[0m {}", result.error()); + VERIFY_NOT_REACHED(); + } + + wake_pipe_fds = result.release_value(); // The wake pipe informs us of POSIX signals as well as manual calls to wake() VERIFY(poll_fds.size() == 0);