summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-21 17:46:35 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-21 17:54:29 +0100
commitb2bb3469fd01cec57f1f1726edb5b851ff8427ad (patch)
tree30b05999b24160506e198f929cd513b8c1a89b1a
parent0721804f03934c17509af4f485c3bcef9d86862c (diff)
bus: poll() on the right fds in proxyd
-rw-r--r--src/bus-proxyd/bus-proxyd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index d8caf406c7..91472d93f1 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -266,6 +266,7 @@ int main(int argc, char *argv[]) {
int events_a, events_b, fd;
uint64_t timeout_a, timeout_b, t;
struct timespec _ts, *ts;
+ struct pollfd *pollfd;
int k;
r = sd_bus_process(a, &m);
@@ -374,14 +375,13 @@ int main(int argc, char *argv[]) {
ts = timespec_store(&_ts, t);
}
- {
- struct pollfd p[3] = {
- {.fd = fd, .events = events_a, },
- {.fd = STDIN_FILENO, .events = events_b & POLLIN, },
- {.fd = STDOUT_FILENO, .events = events_b & POLLOUT, }};
+ pollfd = (struct pollfd[3]) {
+ {.fd = fd, .events = events_a, },
+ {.fd = in_fd, .events = events_b & POLLIN, },
+ {.fd = out_fd, .events = events_b & POLLOUT, }
+ };
- r = ppoll(p, ELEMENTSOF(p), ts, NULL);
- }
+ r = ppoll(pollfd, 3, ts, NULL);
if (r < 0) {
log_error("ppoll() failed: %m");
goto finish;