node: Fix conditions for socket activation
The implementation of socket activation requires not only the `systemd` feature, but also `socket2`.
This commit is contained in:
parent
354805aeb3
commit
4a81673d0e
|
|
@ -321,7 +321,7 @@ impl Runtime {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(feature = "systemd", target_os = "linux"))]
|
#[cfg(all(feature = "socket2", feature = "systemd", target_os = "linux"))]
|
||||||
fn receive_listener() -> Option<UnixListener> {
|
fn receive_listener() -> Option<UnixListener> {
|
||||||
// SAFETY: When `fd` is called, no other threads are spawned (yet).
|
// SAFETY: When `fd` is called, no other threads are spawned (yet).
|
||||||
let fd = match unsafe { radicle_systemd::listen::fd("control") } {
|
let fd = match unsafe { radicle_systemd::listen::fd("control") } {
|
||||||
|
|
@ -352,7 +352,7 @@ impl Runtime {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bind(path: PathBuf) -> Result<ControlSocket, Error> {
|
fn bind(path: PathBuf) -> Result<ControlSocket, Error> {
|
||||||
#[cfg(all(feature = "systemd", target_os = "linux"))]
|
#[cfg(all(feature = "socket2", feature = "systemd", target_os = "linux"))]
|
||||||
{
|
{
|
||||||
if let Some(listener) = Self::receive_listener() {
|
if let Some(listener) = Self::receive_listener() {
|
||||||
log::info!(target: "node", "Received control socket.");
|
log::info!(target: "node", "Received control socket.");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue