+ GPollFD *fds, my_gpollfd;
+ int ret, i;
+
+ g_message("running session");
+ session->running = TRUE;
+ fds = NULL;
+ while (session->running) {
+ if (fds)
+ free(fds);
+
+ /* Construct g_poll()'s array. */
+ fds = malloc(sizeof(GPollFD) * num_sources);
+ for (i = 0; i < num_sources; i++) {
+#ifdef _WIN32
+ g_io_channel_win32_make_pollfd(&channels[0],
+ sources[i].events, &my_gpollfd);
+#else
+ my_gpollfd.fd = sources[i].fd;
+ my_gpollfd.events = sources[i].events;
+ fds[i] = my_gpollfd;
+#endif
+ }