Skip to content

Commit 7015a51

Browse files
committed
Fix Linux build
1 parent 5285895 commit 7015a51

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

  • crates/devolutions-pedm/src

crates/devolutions-pedm/src/lib.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,21 @@ impl Task for PedmTask {
3636
const NAME: &'static str = "devolutions-pedm";
3737

3838
async fn run(self, mut shutdown_signal: ShutdownSignal) -> anyhow::Result<()> {
39-
select! {
40-
res = api::serve(r"\\.\pipe\DevolutionsPEDM", None) => {
41-
if let Err(e) = &res {
42-
error!(%e, "Named pipe server got error");
39+
cfg_if::cfg_if! {
40+
if #[cfg(target_os = "windows")] {
41+
select! {
42+
res = api::serve(r"\\.\pipe\DevolutionsPEDM", None) => {
43+
if let Err(e) = &res {
44+
error!(%e, "Named pipe server got error");
45+
}
46+
res.map_err(Into::into)
47+
}
48+
_ = shutdown_signal.wait() => {
49+
Ok(())
50+
}
4351
}
44-
res.map_err(Into::into)
45-
}
46-
_ = shutdown_signal.wait() => {
52+
} else {
53+
shutdown_signal.wait().await;
4754
Ok(())
4855
}
4956
}

0 commit comments

Comments
 (0)