From: Jacob McNamee Date: Tue, 7 Jan 2025 11:29:31 +0000 (-0800) Subject: stdio-bridge: fix polled fds X-Git-Tag: v258-rc1~1678 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d1c28b2d8422df700e7d94339ac6052a6755c6c;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/stdio-bridge/stdio-bridge.c b/src/stdio-bridge/stdio-bridge.c index 22570511cba..f48b7e574e3 100644 --- a/src/stdio-bridge/stdio-bridge.c +++ b/src/stdio-bridge/stdio-bridge.c @@ -236,9 +236,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);