deps: make libc optional

libc dependency is only use by the lianad
binary it is not needed for liana-gui.
This commit makes the dependency optional
by introducing a new default feature named
daemon.

liana/src/daemonize.rs is still compiling
because the feature daemon is marked as required
for the lianad binary.
This commit is contained in:
edouard committed 2023-03-14 09:39:36 +01:00
1 parent 1d6a34e910
commit cc88446717
2 files changed
+6 -5

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
mod bitcoin;
pub mod commands;
pub mod config;
#[cfg(unix)]
#[cfg(all(unix, feature = "daemon"))]
mod daemonize;
mod database;
pub mod descriptors;
@@ -381,7 +381,7 @@ impl DaemonHandle {
// If we are on a UNIX system and they told us to daemonize, do it now.
// NOTE: it's safe to daemonize now, as we don't carry any open DB connection
// https://www.sqlite.org/howtocorrupt.html#_carrying_an_open_database_connection_across_a_fork_
#[cfg(unix)]
#[cfg(all(unix, feature = "daemon"))]
if config.daemon {
log::info!("Daemonizing");
let log_file = data_dir.as_path().join("log");