From daa77632d1d769f280b6645bec2ab01adc8cefe5 Mon Sep 17 00:00:00 2001 From: Jacob McNamee Date: Tue, 7 Jan 2025 03:29:31 -0800 Subject: [PATCH] stdio-bridge: fix polled fds Poll fds associated with the bus instead of hardcoding stdin/stdout. This is consequential under socket activation, when the provided fd should be used instead of stdin/stdout. (cherry picked from commit 9d1c28b2d8422df700e7d94339ac6052a6755c6c) (cherry picked from commit 59f5a4323468befbdca2bae7907219eaf8852f9a) (cherry picked from commit a398d18e797d5b4dec6d265e753f8b688ffcd570) (cherry picked from commit 0ae29e637c76a41d6e0ddf9f41d4c5e46b398d92) (cherry picked from commit fb92304041cd203d2ca84cc28721dea5e1355c4e) (cherry picked from commit eab1d9753b13a694e4ce64475b351fa1a258db9d) --- src/stdio-bridge/stdio-bridge.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stdio-bridge/stdio-bridge.c b/src/stdio-bridge/stdio-bridge.c index b1429dfc3de..2af43b04f99 100644 --- a/src/stdio-bridge/stdio-bridge.c +++ b/src/stdio-bridge/stdio-bridge.c @@ -244,9 +244,9 @@ static int run(int argc, char *argv[]) { t = usec_sub_unsigned(MIN(timeout_a, timeout_b), now(CLOCK_MONOTONIC)); struct pollfd p[3] = { - { .fd = fd, .events = events_a }, - { .fd = STDIN_FILENO, .events = events_b & POLLIN }, - { .fd = STDOUT_FILENO, .events = events_b & POLLOUT }, + { .fd = fd, .events = events_a }, + { .fd = in_fd, .events = events_b & POLLIN }, + { .fd = out_fd, .events = events_b & POLLOUT }, }; r = ppoll_usec(p, ELEMENTSOF(p), t);