aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2012-05-09 22:27:24 -0700
committerPaul Eggert2012-05-09 22:27:24 -0700
commit97107e2e531ee355f517990eed735fa657b7105b (patch)
tree478acd96426af45cd8d5154ed59346c708321bca
parent12959e8ec2d9a3d075f1e752be96d45817a9289d (diff)
downloademacs-97107e2e531ee355f517990eed735fa657b7105b.tar.gz
emacs-97107e2e531ee355f517990eed735fa657b7105b.zip
* xgselect.c (xg_select): Put maxfds+1 into a var.
This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
-rw-r--r--src/ChangeLog3
-rw-r--r--src/xgselect.c8
2 files changed, 7 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f5b18b8d13a..84764cfc5fc 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12012-05-10 Paul Eggert <eggert@cs.ucla.edu> 12012-05-10 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * xgselect.c (xg_select): Put maxfds+1 into a var.
4 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
5
3 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA. 6 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
4 7
52012-05-10 Dave Abrahams <dave@boostpro.com> 82012-05-10 Dave Abrahams <dave@boostpro.com>
diff --git a/src/xgselect.c b/src/xgselect.c
index 80dbfc32aee..7a09c37c50d 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -41,7 +41,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
41 GMainContext *context = g_main_context_default (); 41 GMainContext *context = g_main_context_default ();
42 int have_wfds = wfds != NULL; 42 int have_wfds = wfds != NULL;
43 int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0; 43 int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0;
44 int i, nfds, tmo_in_millisec; 44 int i, nfds, fds_lim, tmo_in_millisec;
45 45
46 if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); 46 if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds));
47 else FD_ZERO (&all_rfds); 47 else FD_ZERO (&all_rfds);
@@ -97,14 +97,14 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
97 if (our_tmo) tmop = &tmo; 97 if (our_tmo) tmop = &tmo;
98 } 98 }
99 99
100 nfds = select (max_fds+1, &all_rfds, have_wfds ? &all_wfds : NULL, 100 fds_lim = max_fds + 1;
101 efds, tmop); 101 nfds = select (fds_lim, &all_rfds, have_wfds ? &all_wfds : NULL, efds, tmop);
102 102
103 if (nfds < 0) 103 if (nfds < 0)
104 retval = nfds; 104 retval = nfds;
105 else if (nfds > 0) 105 else if (nfds > 0)
106 { 106 {
107 for (i = 0; i < max_fds+1; ++i) 107 for (i = 0; i < fds_lim; ++i)
108 { 108 {
109 if (FD_ISSET (i, &all_rfds)) 109 if (FD_ISSET (i, &all_rfds))
110 { 110 {