Update dependencies
This commit is contained in:
parent
3f2af19d9e
commit
4eb631c9a1
3 changed files with 51 additions and 37 deletions
20
src/main.rs
20
src/main.rs
|
|
@ -80,6 +80,16 @@ pub fn icon_cache_get(name: &'static str, size: u16) -> icon::Icon {
|
|||
}
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
#[cfg(all(unix, not(target_os = "redox")))]
|
||||
match fork::daemon(true, true) {
|
||||
Ok(fork::Fork::Child) => (),
|
||||
Ok(fork::Fork::Parent(_child_pid)) => process::exit(0),
|
||||
Err(err) => {
|
||||
eprintln!("failed to daemonize: {:?}", err);
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
ICON_CACHE.get_or_init(|| Mutex::new(IconCache::new()));
|
||||
LINE_NUMBER_CACHE.get_or_init(|| Mutex::new(LineNumberCache::new()));
|
||||
SWASH_CACHE.get_or_init(|| Mutex::new(SwashCache::new()));
|
||||
|
|
@ -121,16 +131,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
});
|
||||
|
||||
#[cfg(all(unix, not(target_os = "redox")))]
|
||||
match fork::daemon(true, true) {
|
||||
Ok(fork::Fork::Child) => (),
|
||||
Ok(fork::Fork::Parent(_child_pid)) => process::exit(0),
|
||||
Err(err) => {
|
||||
eprintln!("failed to daemonize: {:?}", err);
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("warn")).init();
|
||||
|
||||
localize::localize();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue