- std::map<int,eSocketNotifier*>::iterator it(notifiers.begin());
- for (int i=0; i < fdcount; i++, it++)
- {
- pfd[i].fd = it->first;
- pfd[i].events = it->second->getRequested();
+ if (additional)
+ fdcount += PyDict_Size(additional);
+
+ // 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)
+ {
+ 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);