mirror of
https://github.com/rosenpass/rosenpass.git
synced 2026-03-01 23:13:13 -08:00
Enable privileged only on linux
This commit is contained in:
@@ -1,4 +1,10 @@
|
|||||||
#![cfg(target_os = "linux")]
|
fn main() {
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
linux::main().unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
pub mod linux {
|
||||||
use std::io::{stdin, stdout, Read, Write};
|
use std::io::{stdin, stdout, Read, Write};
|
||||||
use std::result::Result;
|
use std::result::Result;
|
||||||
|
|
||||||
@@ -18,7 +24,7 @@ pub enum BrokerAppError {
|
|||||||
OversizedMessage(u64),
|
OversizedMessage(u64),
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<(), BrokerAppError> {
|
pub fn main() -> Result<(), BrokerAppError> {
|
||||||
let mut broker = BrokerServer::new(wg::NetlinkWireGuardBroker::new()?);
|
let mut broker = BrokerServer::new(wg::NetlinkWireGuardBroker::new()?);
|
||||||
|
|
||||||
let mut stdin = stdin().lock();
|
let mut stdin = stdin().lock();
|
||||||
@@ -55,3 +61,4 @@ fn main() -> Result<(), BrokerAppError> {
|
|||||||
stdout.flush()?;
|
stdout.flush()?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#![cfg(target_os = "linux")]
|
|
||||||
use std::process::Stdio;
|
use std::process::Stdio;
|
||||||
|
|
||||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
||||||
|
|||||||
Reference in New Issue
Block a user