Skip to content

Commit

Permalink
stdio-bridge: fix polled fds
Browse files Browse the repository at this point in the history
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 fb92304)
(cherry picked from commit eab1d97)
  • Loading branch information
jacobmcnamee authored and bluca committed Jan 9, 2025
1 parent 8972f48 commit daa7763
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stdio-bridge/stdio-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit daa7763

Please sign in to comment.