Skip to content

Commit fb92304

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)
1 parent ffcc646 commit fb92304

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
@@ -238,9 +238,9 @@ static int run(int argc, char *argv[]) {
238238
t = usec_sub_unsigned(MIN(timeout_a, timeout_b), now(CLOCK_MONOTONIC));
239239

240240
struct pollfd p[3] = {
241-
{ .fd = fd, .events = events_a },
242-
{ .fd = STDIN_FILENO, .events = events_b & POLLIN },
243-
{ .fd = STDOUT_FILENO, .events = events_b & POLLOUT },
241+
{ .fd = fd, .events = events_a },
242+
{ .fd = in_fd, .events = events_b & POLLIN },
243+
{ .fd = out_fd, .events = events_b & POLLOUT },
244244
};
245245

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

0 commit comments

Comments
 (0)