GMainContext *context = g_main_context_default ();
int have_wfds = wfds != NULL;
int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0;
- int prio, i, nfds, tmo_in_millisec;
+ int i, nfds, tmo_in_millisec;
if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds));
else FD_ZERO (&all_rfds);
g_main_context_pending (context);
do {
- if (n_gfds > gfds_size)
+ if (n_gfds > gfds_size)
{
- while (n_gfds > gfds_size)
+ while (n_gfds > gfds_size)
gfds_size *= 2;
xfree (gfds);
gfds = xmalloc (sizeof (*gfds) * gfds_size);
gfds_size);
} while (n_gfds > gfds_size);
- for (i = 0; i < n_gfds; ++i)
+ for (i = 0; i < n_gfds; ++i)
{
if (gfds[i].events & G_IO_IN)
{
else
{
EMACS_TIME difference;
-
+
EMACS_SUB_TIME (difference, tmo, *timeout);
if (EMACS_TIME_NEG_P (difference)) our_tmo = 1;
}
if (nfds < 0)
retval = nfds;
- else if (nfds > 0)
+ else if (nfds > 0)
{
for (i = 0; i < max_fds+1; ++i)
{
if (our_fds > 0 || (nfds == 0 && our_tmo))
{
-
+
/* If Gtk+ is in use eventually gtk_main_iteration will be called,
unless retval is zero. */
#ifdef USE_GTK
g_main_context_dispatch (context);
/* To not have to recalculate timeout, return like this. */
- if (retval == 0)
+ if (retval == 0)
{
retval = -1;
errno = EINTR;
gfds = xmalloc (sizeof (*gfds)*gfds_size);
#endif /* defined (USE_GTK) || defined (HAVE_GCONF) */
}
-