diff options
author | Ken Brown <kbrown@cornell.edu> | 2012-05-21 09:35:40 -0400 |
---|---|---|
committer | Ken Brown <kbrown@cornell.edu> | 2012-05-21 09:35:40 -0400 |
commit | ff23cd9f452b6d2b5001a67d7b14e0af7f61b194 (patch) | |
tree | 98e6c1bddef3b36ea89e9e27ed238778295c0086 /src | |
parent | e1939eb1e4576b653c42c92497f795bea7c12084 (diff) | |
download | emacs-ff23cd9f452b6d2b5001a67d7b14e0af7f61b194.tar.gz |
* src/xgselect.c (xg_select): Fix first argument in call to 'select' (bug#11508).
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/xgselect.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ea898893073..b9e91d308cc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-05-21 Ken Brown <kbrown@cornell.edu> + + * xgselect.c (xg_select): Fix first argument in call to 'select' + (bug#11508). + 2012-05-20 Ken Brown <kbrown@cornell.edu> * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock) diff --git a/src/xgselect.c b/src/xgselect.c index 69ad93b3127..9d6a3ba774a 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -33,7 +33,7 @@ static GPollFD *gfds; static ptrdiff_t gfds_size; int -xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, +xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, EMACS_TIME *timeout) { SELECT_TYPE all_rfds, all_wfds; @@ -41,11 +41,11 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, GMainContext *context; int have_wfds = wfds != NULL; - int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0; - int i, nfds, fds_lim, tmo_in_millisec; + int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0, max_fds = fds_lim - 1; + int i, nfds, tmo_in_millisec; if (!x_in_use) - return select (max_fds, rfds, wfds, efds, timeout); + return select (fds_lim, rfds, wfds, efds, timeout); if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); else FD_ZERO (&all_rfds); |