}
}
- struct pollfd pfds[realFDs.size()];
- memset(&pfds[0], 0, realFDs.size()*sizeof(struct pollfd));
+ std::vector<struct pollfd> pfds(realFDs.size());
+ memset(&pfds.at(0), 0, realFDs.size()*sizeof(struct pollfd));
int ctr = 0;
for (const auto& fd : realFDs) {
pfds[ctr].fd = fd;
int ret;
if(seconds >= 0)
- ret = poll(pfds, realFDs.size(), seconds * 1000 + useconds/1000);
+ ret = poll(&pfds.at(0), realFDs.size(), seconds * 1000 + useconds/1000);
else
- ret = poll(pfds, realFDs.size(), -1);
+ ret = poll(&pfds.at(0), realFDs.size(), -1);
if(ret <= 0)
return ret;