aboutsummaryrefslogtreecommitdiffstats
path: root/src/xgselect.c
diff options
context:
space:
mode:
authorJoakim Verona2013-09-10 23:26:38 +0200
committerJoakim Verona2013-09-10 23:26:38 +0200
commit92aeabcc8a007f521a664e3aee092eb80ad0f49a (patch)
tree58fde2f218fa45ee1b2c67184b50137a8fb6e140 /src/xgselect.c
parentebc2ba4f6049d17fd41d2f1fc8d65efe309f6bf4 (diff)
parent43aac990c339c0fc3304aa476ebc8ea8467f107e (diff)
downloademacs-92aeabcc8a007f521a664e3aee092eb80ad0f49a.tar.gz
emacs-92aeabcc8a007f521a664e3aee092eb80ad0f49a.zip
merge from trunk
Conflicts: src/dispnew.c
Diffstat (limited to 'src/xgselect.c')
-rw-r--r--src/xgselect.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/xgselect.c b/src/xgselect.c
index 97f53373b63..45a34f2e0a5 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -25,15 +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, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
32 EMACS_TIME const *timeout, sigset_t const *sigmask) 33 struct timespec const *timeout, sigset_t const *sigmask)
33{ 34{
34 SELECT_TYPE all_rfds, all_wfds; 35 SELECT_TYPE all_rfds, all_wfds;
35 EMACS_TIME tmo; 36 struct timespec tmo;
36 EMACS_TIME const *tmop = timeout; 37 struct timespec const *tmop = timeout;
37 38
38 GMainContext *context; 39 GMainContext *context;
39 int have_wfds = wfds != NULL; 40 int have_wfds = wfds != NULL;
@@ -86,9 +87,9 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
86 87
87 if (tmo_in_millisec >= 0) 88 if (tmo_in_millisec >= 0)
88 { 89 {
89 tmo = make_emacs_time (tmo_in_millisec / 1000, 90 tmo = make_timespec (tmo_in_millisec / 1000,
90 1000 * 1000 * (tmo_in_millisec % 1000)); 91 1000 * 1000 * (tmo_in_millisec % 1000));
91 if (!timeout || EMACS_TIME_LT (tmo, *timeout)) 92 if (!timeout || timespec_cmp (tmo, *timeout) < 0)
92 tmop = &tmo; 93 tmop = &tmo;
93 } 94 }
94 95