aboutsummaryrefslogtreecommitdiffstats
path: root/src/xgselect.c
diff options
context:
space:
mode:
authorXue Fuqiao2013-09-04 08:39:34 +0800
committerXue Fuqiao2013-09-04 08:39:34 +0800
commitadf2fc4a01efe77d73cd52bc9173914ed56ff531 (patch)
treea5a280a5554a7bffeaf94fccae29fa3ac1a5d066 /src/xgselect.c
parent63191d9f2043d2e67657e85a7b3842805dd1dad6 (diff)
parent38726039b77db432989fed106c88e9f1aa463281 (diff)
downloademacs-adf2fc4a01efe77d73cd52bc9173914ed56ff531.tar.gz
emacs-adf2fc4a01efe77d73cd52bc9173914ed56ff531.zip
Merge from mainline.
Diffstat (limited to 'src/xgselect.c')
-rw-r--r--src/xgselect.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/xgselect.c b/src/xgselect.c
index 4d90298a9d9..7a754bd75c0 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -25,14 +25,16 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
25 25
26#include <glib.h> 26#include <glib.h>
27#include <errno.h> 27#include <errno.h>
28#include <timespec.h>
28#include "frame.h" 29#include "frame.h"
29 30
30int 31int
31xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, 32xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
32 EMACS_TIME *timeout, sigset_t *sigmask) 33 struct timespec const *timeout, sigset_t const *sigmask)
33{ 34{
34 SELECT_TYPE all_rfds, all_wfds; 35 fd_set all_rfds, all_wfds;
35 EMACS_TIME tmo, *tmop = timeout; 36 struct timespec tmo;
37 struct timespec const *tmop = timeout;
36 38
37 GMainContext *context; 39 GMainContext *context;
38 int have_wfds = wfds != NULL; 40 int have_wfds = wfds != NULL;
@@ -85,9 +87,9 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
85 87
86 if (tmo_in_millisec >= 0) 88 if (tmo_in_millisec >= 0)
87 { 89 {
88 tmo = make_emacs_time (tmo_in_millisec / 1000, 90 tmo = make_timespec (tmo_in_millisec / 1000,
89 1000 * 1000 * (tmo_in_millisec % 1000)); 91 1000 * 1000 * (tmo_in_millisec % 1000));
90 if (!timeout || EMACS_TIME_LT (tmo, *timeout)) 92 if (!timeout || timespec_cmp (tmo, *timeout) < 0)
91 tmop = &tmo; 93 tmop = &tmo;
92 } 94 }
93 95