diff options
author | Matias Linares <matiaslina@openmailbox.org> | 2015-11-22 20:07:01 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@openmailbox.org> | 2015-11-22 20:07:01 -0300 |
commit | e99ad3688971fde57cf34d4a9f5dd89256c7ab78 (patch) | |
tree | 82d52e2589155c823b163fa1302c85b49330df6b /src/event.rs | |
parent | 83b7d0cb4f30c95ce6f27d2c0944727d75eb6e5e (diff) | |
download | dotwm-e99ad3688971fde57cf34d4a9f5dd89256c7ab78.tar.gz |
Move the file descriptor of the socket to the select event.
Diffstat (limited to 'src/event.rs')
-rw-r--r-- | src/event.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/event.rs b/src/event.rs index f683c63..6f5c427 100644 --- a/src/event.rs +++ b/src/event.rs @@ -32,6 +32,7 @@ use std::fmt; use std::ptr; use std::mem::uninitialized; use std::cmp::max; +use std::os::unix::io::AsRawFd; use safe_x11::next_xevent; @@ -73,13 +74,13 @@ impl fmt::Debug for Event { } } -pub unsafe fn select_event(display: *mut Display, x11fd: c_int, socket_fd: c_int, - listener: &UnixListener) -> Event { +pub unsafe fn select_event(display: *mut Display, x11fd: c_int, listener: &UnixListener) -> Event { // Return right now if there're some XEvent on the queue if XPending(display) > 0 { return next_event(display); } + let socket_fd = listener.as_raw_fd(); let mut read_fdset: fd_set = uninitialized(); FD_ZERO(&mut read_fdset); |