Commit f8626941 authored by Paul Eggert's avatar Paul Eggert

* xgselect.c (xg_select): Don't assume n_gfds is nonnegative

merely because tmo_in_millisec is nonnegative.  The 1st call
to g_main_context_query could succeed while the 2nd one fails.
parent 0cd3403f
2014-11-09 Paul Eggert <eggert@cs.ucla.edu>
* xgselect.c (xg_select): Don't assume n_gfds is nonnegative
merely because tmo_in_millisec is nonnegative. The 1st call
to g_main_context_query could succeed while the 2nd one fails.
* frame.c (Fcan_run_window_configuration_change_hook): Return a value.
2014-11-08 Jan Djärv <jan.h.d@swipnet.se>
......
......@@ -56,7 +56,7 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
int gfds_size = ARRAYELTS (gfds_buf);
int n_gfds, retval = 0, our_fds = 0, max_fds = fds_lim - 1;
bool context_acquired = false;
int i, nfds, tmo_in_millisec = -1;
int i, nfds, tmo_in_millisec;
bool need_to_dispatch;
USE_SAFE_ALLOCA;
......@@ -102,7 +102,7 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
SAFE_FREE ();
if (tmo_in_millisec >= 0)
if (n_gfds >= 0 && tmo_in_millisec >= 0)
{
tmo = make_timespec (tmo_in_millisec / 1000,
1000 * 1000 * (tmo_in_millisec % 1000));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment