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.
This commit is contained in:
committed by
Daan De Meyer
parent
3c9ffd2e4b
commit
9d1c28b2d8
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user