aboutsummaryrefslogtreecommitdiffstats
path: root/configd/src/apps/sentinel/manager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'configd/src/apps/sentinel/manager.cpp')
-rw-r--r--configd/src/apps/sentinel/manager.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/configd/src/apps/sentinel/manager.cpp b/configd/src/apps/sentinel/manager.cpp
index 36bdef0dd8a..9ee259bb892 100644
--- a/configd/src/apps/sentinel/manager.cpp
+++ b/configd/src/apps/sentinel/manager.cpp
@@ -170,16 +170,17 @@ Manager::handleChildDeaths()
}
void
-Manager::updateActiveFdset(fd_set *fds, int *maxNum)
+Manager::updateActiveFdset(std::vector<pollfd> &fds)
{
- // ### _Possibly put an assert here if fd is > 1023???
- for (OutputConnection *c : _outputConnections) {
+ fds.clear();
+ for (const OutputConnection *c : _outputConnections) {
int fd = c->fd();
if (fd >= 0) {
- FD_SET(fd, fds);
- if (fd >= *maxNum) {
- *maxNum = fd + 1;
- }
+ fds.emplace_back();
+ auto &ev = fds.back();
+ ev.fd = fd;
+ ev.events = POLLIN;
+ ev.revents = 0;
}
}
}