- for (int i=0; i < fdcount; i++, fd_merged_it++)
- {
- pfd[i].fd = fd_merged_it->first;
- pfd[i].events = fd_merged_it->second;
+ // build the poll aray
+ pollfd pfd[fdcount]; // make new pollfd array
+ std::map<int,eSocketNotifier*>::iterator it = notifiers.begin();
+ int i=0;
+ for (; i < nativecount; ++i, ++it)
+ {
+ it->second->state = 1; // running and in poll
+ pfd[i].fd = it->first;
+ pfd[i].events = it->second->getRequested();
+ }
+
+ if (additional)
+ {
+ PyObject *key, *val;
+ int pos=0;
+ while (PyDict_Next(additional, &pos, &key, &val)) {
+ pfd[i].fd = PyObject_AsFileDescriptor(key);
+ pfd[i++].events = PyInt_AsLong(val);