fix some logind backend errors
This commit is contained in:
parent
269c9a5c7c
commit
53d27264a2
|
@ -151,7 +151,7 @@ pub fn auto_session_bind<Data: 'static>(
|
||||||
) -> ::std::result::Result<BoundAutoSession, IoError> {
|
) -> ::std::result::Result<BoundAutoSession, IoError> {
|
||||||
Ok(match notifier {
|
Ok(match notifier {
|
||||||
#[cfg(feature = "backend_session_logind")]
|
#[cfg(feature = "backend_session_logind")]
|
||||||
AutoSessionNotifier::Logind(logind) => BoundAutoSession::Logind(logind_session_bind(logind, handle)?),
|
AutoSessionNotifier::Logind(logind) => BoundAutoSession::Logind(logind_session_bind(logind, handle).map_err(|(e, _)| e)?),
|
||||||
AutoSessionNotifier::Direct(direct) => BoundAutoSession::Direct(direct_session_bind(direct, handle)?),
|
AutoSessionNotifier::Direct(direct) => BoundAutoSession::Direct(direct_session_bind(direct, handle)?),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
|
||||||
use systemd::login;
|
use systemd::login;
|
||||||
|
|
||||||
use wayland_server::calloop::generic::{Event, EventedRawFd, Generic};
|
use wayland_server::calloop::generic::{Event, EventedRawFd, Generic};
|
||||||
use wayland_server::calloop::{Loophandle, Ready, Source};
|
use wayland_server::calloop::{LoopHandle, Ready, Source};
|
||||||
|
|
||||||
struct LogindSessionImpl {
|
struct LogindSessionImpl {
|
||||||
conn: RefCell<Connection>,
|
conn: RefCell<Connection>,
|
||||||
|
@ -453,7 +453,7 @@ pub fn logind_session_bind<Data: 'static>(
|
||||||
let notifier = notifier.clone();
|
let notifier = notifier.clone();
|
||||||
move |evt, _| notifier.event(evt)
|
move |evt, _| notifier.event(evt)
|
||||||
})
|
})
|
||||||
}).collect::<::std::result::Result<Vec<Source<FdEvent>>, IoError>>()
|
}).collect::<::std::result::Result<Vec<Source<Generic<EventedRawFd>>>, IoError>>()
|
||||||
.map_err(|err| {
|
.map_err(|err| {
|
||||||
(
|
(
|
||||||
err,
|
err,
|
||||||
|
@ -496,7 +496,7 @@ impl Drop for LogindSessionNotifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LogindSessionNotifier {
|
impl LogindSessionNotifier {
|
||||||
fn event(&mut self, event: Event) {
|
fn event(&mut self, event: Event<EventedRawFd>) {
|
||||||
let fd = event.source.borrow().0;
|
let fd = event.source.borrow().0;
|
||||||
let readiness = event.readiness;
|
let readiness = event.readiness;
|
||||||
let conn = self.internal.conn.borrow();
|
let conn = self.internal.conn.borrow();
|
||||||
|
|
Loading…
Reference in New Issue