Skip to content

Commit aa18040

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 9d1c28b) (cherry picked from commit 59f5a4323468befbdca2bae7907219eaf8852f9a) (cherry picked from commit a398d18) (cherry picked from commit 0ae29e6) (cherry picked from commit fb92304) (cherry picked from commit eab1d97) (cherry picked from commit daa7763)
1 parent b01e8c1 commit aa18040

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/stdio-bridge/stdio-bridge.c

Lines changed: 3 additions & 3 deletions
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)