fix windows

This commit is contained in:
John Smith 2022-07-12 13:07:02 -04:00
parent 529aa93ab7
commit 007150c818
2 changed files with 3 additions and 2 deletions

View File

@ -83,7 +83,7 @@ fn main() -> EyreResult<()> {
if settings.read().daemon.enabled { if settings.read().daemon.enabled {
cfg_if! { cfg_if! {
if #[cfg(windows)] { if #[cfg(windows)] {
return windows::run_service(settings, matches).map_err(|e| format!("{}", e)); return windows::run_service(settings, matches);
} else if #[cfg(unix)] { } else if #[cfg(unix)] {
return unix::run_daemon(settings, matches); return unix::run_daemon(settings, matches);
} }

View File

@ -1,4 +1,5 @@
use crate::settings::*; use crate::settings::*;
use crate::*;
use clap::ArgMatches; use clap::ArgMatches;
use std::ffi::OsString; use std::ffi::OsString;
use std::time::Duration; use std::time::Duration;
@ -11,7 +12,7 @@ use windows_service::*;
// Register generated `ffi_service_main` with the system and start the service, blocking // Register generated `ffi_service_main` with the system and start the service, blocking
// this thread until the service is stopped. // this thread until the service is stopped.
pub fn run_service(settings: Settings, matches: ArgMatches) -> windows_service::Result<()> { pub fn run_service(settings: Settings, matches: ArgMatches) -> EyreResult<()> {
eprintln!("Windows Service mode not implemented yet."); eprintln!("Windows Service mode not implemented yet.");
//service_dispatcher::start("veilid-server", ffi_veilid_service_main)?; //service_dispatcher::start("veilid-server", ffi_veilid_service_main)?;