mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-02 06:51:28 +03:00
quit cm process if ipc connection to ipc server closed (#9292)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -84,6 +84,7 @@ lazy_static::lazy_static! {
|
||||
// Is server logic running. The server code can invoked to run by the main process if --server is not running.
|
||||
static ref SERVER_RUNNING: Arc<RwLock<bool>> = Default::default();
|
||||
static ref IS_MAIN: bool = std::env::args().nth(1).map_or(true, |arg| !arg.starts_with("--"));
|
||||
static ref IS_CM: bool = std::env::args().nth(1) == Some("--cm".to_owned()) || std::env::args().nth(1) == Some("--cm-no-ui".to_owned());
|
||||
}
|
||||
|
||||
pub struct SimpleCallOnReturn {
|
||||
@@ -137,6 +138,11 @@ pub fn is_main() -> bool {
|
||||
*IS_MAIN
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_cm() -> bool {
|
||||
*IS_CM
|
||||
}
|
||||
|
||||
// Is server logic running.
|
||||
#[inline]
|
||||
pub fn is_server_running() -> bool {
|
||||
|
||||
Reference in New Issue
Block a user