diff options
Diffstat (limited to 'src/xgselect.c')
| -rw-r--r-- | src/xgselect.c | 16 |
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 | ||
| 30 | int | 31 | int |
| 31 | xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, | 32 | xg_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 | ||