src/tools/daemon.rs: switch to async
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
		| @ -189,7 +189,7 @@ impl Reloadable for tokio::net::TcpListener { | |||||||
|         fd_change_cloexec(fd, true)?; |         fd_change_cloexec(fd, true)?; | ||||||
|         Ok(Self::from_std( |         Ok(Self::from_std( | ||||||
|             unsafe { std::net::TcpListener::from_raw_fd(fd) }, |             unsafe { std::net::TcpListener::from_raw_fd(fd) }, | ||||||
|             &tokio::reactor::Handle::default(), |             &tokio_net::driver::Handle::default(), | ||||||
|         )?) |         )?) | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -203,10 +203,10 @@ impl Reloadable for tokio::net::TcpListener { | |||||||
| pub fn create_daemon<F, S>( | pub fn create_daemon<F, S>( | ||||||
|     address: std::net::SocketAddr, |     address: std::net::SocketAddr, | ||||||
|     create_service: F, |     create_service: F, | ||||||
| ) -> Result<impl Future<Item = (), Error = ()>, Error> | ) -> Result<impl Future<Output = ()>, Error> | ||||||
| where | where | ||||||
|     F: FnOnce(tokio::net::TcpListener) -> Result<S, Error>, |     F: FnOnce(tokio::net::TcpListener) -> Result<S, Error>, | ||||||
|     S: Future<Item = (), Error = ()>, |     S: Future<Output = ()>, | ||||||
| { | { | ||||||
|     let mut reloader = Reloader::new(); |     let mut reloader = Reloader::new(); | ||||||
|  |  | ||||||
| @ -235,7 +235,6 @@ where | |||||||
|                log::info!("daemon shutting down..."); |                log::info!("daemon shutting down..."); | ||||||
|            } |            } | ||||||
|        }) |        }) | ||||||
|        .map_err(|_| ()) |  | ||||||
|     ) |     ) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user