Skip to content

Commit eab1d97

Browse files
jacobmcnameebluca
authored andcommitted
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 a398d18) (cherry picked from commit 0ae29e6) (cherry picked from commit fb92304)
1 parent f028f22 commit eab1d97

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/stdio-bridge/stdio-bridge.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ static int run(int argc, char *argv[]) {
244244
t = usec_sub_unsigned(MIN(timeout_a, timeout_b), now(CLOCK_MONOTONIC));
245245

246246
struct pollfd p[3] = {
247-
{ .fd = fd, .events = events_a },
248-
{ .fd = STDIN_FILENO, .events = events_b & POLLIN },
249-
{ .fd = STDOUT_FILENO, .events = events_b & POLLOUT },
247+
{ .fd = fd, .events = events_a },
248+
{ .fd = in_fd, .events = events_b & POLLIN },
249+
{ .fd = out_fd, .events = events_b & POLLOUT },
250250
};
251251

252252
r = ppoll_usec(p, ELEMENTSOF(p), t);

0 commit comments

Comments
 (0)