/* Function for handling the GLib event loop.
- Copyright (C) 2009, 2010
- Free Software Foundation, Inc.
+
+Copyright (C) 2009-2011 Free Software Foundation, Inc.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-#include "config.h"
+#include <config.h>
#if defined (USE_GTK) || defined (HAVE_GCONF)
#include <glib.h>
static int gfds_size;
int
-xg_select (max_fds, rfds, wfds, efds, timeout)
- int max_fds;
- SELECT_TYPE *rfds;
- SELECT_TYPE *wfds;
- SELECT_TYPE *efds;
- EMACS_TIME *timeout;
+xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
+ EMACS_TIME *timeout)
{
SELECT_TYPE all_rfds, all_wfds;
EMACS_TIME tmo, *tmop = timeout;
if (rfds && FD_ISSET (i, rfds)) ++retval;
else ++our_fds;
}
+ else if (rfds)
+ FD_CLR (i, rfds);
+
if (have_wfds && FD_ISSET (i, &all_wfds))
{
if (wfds && FD_ISSET (i, wfds)) ++retval;
else ++our_fds;
}
+ else if (wfds)
+ FD_CLR (i, wfds);
+
if (efds && FD_ISSET (i, efds))
++retval;
}
#endif /* defined (USE_GTK) || defined (HAVE_GCONF) */
void
-xgselect_initialize ()
+xgselect_initialize (void)
{
#if defined (USE_GTK) || defined (HAVE_GCONF)
gfds_size = 128;
#endif /* defined (USE_GTK) || defined (HAVE_GCONF) */
}
-/* arch-tag: c5873ee3-d1f6-44f9-9f3b-b14f70fd0e6a
- (do not change this comment) */