From 0100d64eb38b1cf9e62363c3bee6f5673d31484d Mon Sep 17 00:00:00 2001 From: "flamingo[bot]" <277372822+flamingo[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 05:15:40 +0000 Subject: [PATCH] fix(OSQUERY-003): PipeChannelFactory::createChannelTicket throws std::runtime_error instead of returning Status --- osquery/worker/ipc/posix/pipe_channel_factory.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/osquery/worker/ipc/posix/pipe_channel_factory.cpp b/osquery/worker/ipc/posix/pipe_channel_factory.cpp index f478a012ba0..1b4b4efc8a5 100644 --- a/osquery/worker/ipc/posix/pipe_channel_factory.cpp +++ b/osquery/worker/ipc/posix/pipe_channel_factory.cpp @@ -21,12 +21,11 @@ PipeChannelTicket::PipeChannelTicket(std::array read_pipe_fds, std::array write_pipe_fds) : read_pipe_fds_(read_pipe_fds), write_pipe_fds_(write_pipe_fds) {} -PipeChannelTicket PipeChannelFactory::createChannelTicket() { - PipeChannelTicket ticket; +Status PipeChannelFactory::createChannelTicket(PipeChannelTicket& ticket) { auto result = pipe(ticket.read_pipe_fds_.data()); if (result == -1) { - throw std::runtime_error( + return Status::failure( "Failed to create parent_write_child_read_pipe, error: " + std::to_string(errno)); } @@ -34,12 +33,12 @@ PipeChannelTicket PipeChannelFactory::createChannelTicket() { result = pipe(ticket.write_pipe_fds_.data()); if (result == -1) { - throw std::runtime_error( + return Status::failure( "Failed to create parent_read_child_write_pipe, error: " + std::to_string(errno)); } - return ticket; + return Status::success(); } PipeChannel& PipeChannelFactory::createChildChannel(